Presentation is loading. Please wait.

Presentation is loading. Please wait.

GUI-Labels, TextBoxes and Buttons Label- displays read-only text Label- displays read-only text Common properties: Common properties: Font – font used.

Similar presentations


Presentation on theme: "GUI-Labels, TextBoxes and Buttons Label- displays read-only text Label- displays read-only text Common properties: Common properties: Font – font used."— Presentation transcript:

1 GUI-Labels, TextBoxes and Buttons Label- displays read-only text Label- displays read-only text Common properties: Common properties: Font – font used by the text of label Font – font used by the text of label Text – text to appear on the label Text – text to appear on the label TextAlign – Alignment of the label’s text TextAlign – Alignment of the label’s text Button – user click to trigger a specific action Button – user click to trigger a specific action Common properties Common properties Text Text Common event Common event click click

2 GUI- TextBoxes Common properties Common properties AcceptsReturn: If true, pressing Enter creates a new line in the text box, if that text box spans multiple lines. If false, press enter clicks the default button of the form AcceptsReturn: If true, pressing Enter creates a new line in the text box, if that text box spans multiple lines. If false, press enter clicks the default button of the form Multiline: if true, text box can span multiple line Multiline: if true, text box can span multiple line PasswordChar:single character to display instead of typed text. PasswordChar:single character to display instead of typed text. ReadOnly: if true, text box has grey background and its text cannot be edited ReadOnly: if true, text box has grey background and its text cannot be edited ScrollBars: for multiple lines text, indicated which scrollbars appear ScrollBars: for multiple lines text, indicated which scrollbars appear Text : text to be displayed in the text box Text : text to be displayed in the text box Common event Common event TextChanged TextChanged

3 GUI-CheckBoxes Checkbox: Checkbox: A group of check boxes allow the user to select combinations of choices. A group of check boxes allow the user to select combinations of choices. Any number may be selected at a time Any number may be selected at a time The text that appear alongside a check box is referred to as the checkbox label. The text that appear alongside a check box is referred to as the checkbox label. Properties Properties Checked Checked CheckState CheckState Events Events CheckedChanged CheckedChanged CheckStateChanged CheckStateChanged

4 GUI-RadioButton RadioButton: RadioButton: Several radio buttons group together Several radio buttons group together Only one of the radio buttons in the group can be selected (true) at any time Only one of the radio buttons in the group can be selected (true) at any time Properties: Properties: Checked : specifies whether the radio button is checked Checked : specifies whether the radio button is checked Text: Text displayed to the right of the radio button Text: Text displayed to the right of the radio button Events: Events: Click: Raised when user click the control Click: Raised when user click the control CheckedChanged: Raised every time the radio button is checked or unchecked CheckedChanged: Raised every time the radio button is checked or unchecked

5 Font property To change the font, the Font property must be set to a Font object To change the font, the Font property must be set to a Font object The Font constructor takes the font name, size and style The Font constructor takes the font name, size and style FontStyle enumeration contains FontStyle enumeration contains Regular Regular Bold Bold Italic Italic Strikeout Strikeout Underline Underline

6 Lb_message->Font = new Drawing::Font( Lb_message->Font = new Drawing::Font( lb_message->Font->name, lb_message->Font->name, lb_message->Font->size, static_cast (lb_mess age->Font->Style lb_message->Font->size, static_cast (lb_mess age->Font->Style ^FontStyle::Italic) ); ^FontStyle::Italic) );

7 Bitwise XOR operator ^ Bitwise operator perform manipulation on bits. Bitwise operator perform manipulation on bits. Actions are taken and data are modified using these bits values Actions are taken and data are modified using these bits values Bitwise XOR operator ^ Bitwise XOR operator ^ 0 ^ 0 = 0 0 && 0 = 0 0 || 0 = 0 0 ^ 0 = 0 0 && 0 = 0 0 || 0 = 0 1 ^ 0 = 1 1 && 0 = 0 1 || 0 = 1 1 ^ 0 = 1 1 && 0 = 0 1 || 0 = 1 0 ^ 1 = 1 0 && 1 = 0 0 || 1 = 1 0 ^ 1 = 1 0 && 1 = 0 0 || 1 = 1 1 ^ 1 = 0 1 && 1 = 1 1 || 1 = 1 1 ^ 1 = 0 1 && 1 = 1 1 || 1 = 1 If style is not bold(0), then set to bold(1) If style is not bold(0), then set to bold(1) If style is already bold(1), then set to not bold(0) If style is already bold(1), then set to not bold(0)

8 MessageBox MessageBox::Show() can take three argument, and return DialogResult MessageBox::Show() can take three argument, and return DialogResult String String MessageBoxButtons MessageBoxButtons OK OK OKCancel OKCancel YesNo YesNo YesNoCancel YesNoCancel AbortRetryIgnore AbortRetryIgnore MessageBoxIcon MessageBoxIcon Error Error Exclamation Exclamation Information Information Question Question

9 DialogResult DialogResult from MessageBox DialogResult from MessageBox Contain enumeration value Contain enumeration value DialogResult::OK DialogResult::OK DialogResult::Cancel DialogResult::Cancel DialogResult::Abort DialogResult::Abort DialogResult::Retry DialogResult::Retry DialogResult::Ignore DialogResult::Ignore DialogResult::Yes DialogResult::Yes DialogResult::No DialogResult::No


Download ppt "GUI-Labels, TextBoxes and Buttons Label- displays read-only text Label- displays read-only text Common properties: Common properties: Font – font used."

Similar presentations


Ads by Google