Thursday, August 1, 2019

Visual Basic Toolbox Controls

The Toolbox Controls The Toolbox window holds all of the controls available to your VB. NET programs. Basic Controls First, let’s focus on the basic controls that are used in most programs. These controls are so essential that VB. NET would be utterly useless without them 1- Button The Button control is a key ingredient for an effective user interface. Buttons are normally found on the main form of a program and are used to perform tasks or bring up additional forms for the user. Notable Properties Important Properties of Button1 from Properties  Window: AppearanceAppearance  section of the properties  window  allows us to make changes to the  appearance  of the Button. With the help of   BackColor  and  Background Image  properties we can set a background color  and a background image to the button. We set the font color and font style for the text that appears on button with  ForeColor  and the  Font  property. We change the appearance  style of the button with the  FlatStyle  property. We can change the text that appears on button with the  Text  property and with the  TextAlign  property we can set where on the button the text should appear from a predefined set of options. BehaviorNotable Behavior properties of the Button are the  Enabled  and  Visible  properties. The Enabled property is set to True by default which makes the button enabled and setting it's  property to  False makes the button Disabled. With the Visible property we can make the Button Visible or Invisible. The default value is set to True and to make the button Invisible set it's property to  False. Layout With the  Location  property you can change the location of the button. With the Size property you can set the size of the button. 2- CheckBox The CheckBox control is a Boolean control that can be set to true or false.When the control’s value is true, the check box will be filled with a small x. Notable Properti es Important properties of the  CheckBox  in the  Appearance  section of the properties  window  are: Appearance: Default value is Normal. Set the value to Button if you want the  CheckBox  to be  displayed  as a Button. BackgroundImage: Used to set a  background image  for the  checkbox. CheckAlign: Used to set the  alignment  for the  CheckBox  from a predefined list. Checked: Default value is False, set it to True if you want the  CheckBox  to be  displayed  as checked. CheckState: Default value is Unchecked. Set it to True if you want a check to appear.When set to Indeterminate it displays a check in gray background. FlatStyle: Default value is  Standard. Select the value from a predefined list to set the style of the  checkbox. 3- Label The Label control is used to display static labels on a form that generally don’t change while a program is running. The labels are commonly used alongside TextBox controls to describe the inf ormation sto red in the TextBox 4- LinkLabel The LinkLabel control is a specialized version of the Label control, which includes an Internet hyperlink so that when you click the label, the link is opened in the default Web browser (or e-mail program). – RadioButton The RadioButton control is useless by itself because a mouse click can only set the value to true, not false (as is the case with CheckBox). RadioButton controls are only useful if two or more are placed together on a form or other container (such as a GroupBox), because they reflect a multiple-choice value as indicated by the selected control, not an individual true/false value. Notable Properties Important properties of the RadioButton in the  Appearance  section of the properties  window  are: Appearance: Default value is Normal.Set the value to Button if you want the RadioButton to be  displayed  as a Button. BackgroundImage: Used to set a  background image  for the RadioButton. CheckAlign: Used to set the  alignment  for the RadioButton from a predefined list. Checked: Default value is False, set it to True if you want the RadioButton to be  displayed  as checked. FlatStyle: Default value is  Standard. Select the value from a predefined list to set the style of the RadioButton. TextBox The TextBox control is a multi-purpose keyboard input and text output control capable of displaying multiple lines of text with automatic word wrapping.Some Notable Properties: Some important properties in the Behavior section of  the Properties  Window  for  TextBoxes. Enabled: Default value is True. To disable,  set the  property to  False. Multiline: Setting this  property to  True makes the TextBox multiline which allows to accept multiple lines of text. Default value is False. PasswordChar: Used to set the password character. The text displayed in the TextBox will be the character set by the user. Say, if you enter *,   the text that is entered in the Text Box is displayed as *. ReadOnly: Makes this TextBox readonly.It doesn't allow to enter any text. Visible: Default value is True. To hide it set the  property to  False. Important properties in the  Appearance  section TextAlign: Allows to align the text from three possible  options. The default value is left and you can set the  alignment  of text to right or center. Scrollbars: Allows to add a  scrollbar  to a Textbox. Very useful when the TextBox is multiline. You have four  options  with  this property. Options  are are None, Horizontal, Vertical and Both. Depending on the size of the TextBox anyone of those can be used

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.