0% found this document useful (0 votes)
213 views3 pages

Property/ Method Description: Properties

Controls in VB allow creating graphical user interface (GUI) objects on forms. Common controls include text boxes, list boxes, and combo boxes. Text boxes allow entering text, list boxes display vertical lists, and combo boxes combine a text box and drop down list. Combo boxes have three styles: drop down combo, simple combo, and drop down list.

Uploaded by

Huidrom Sharat
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
213 views3 pages

Property/ Method Description: Properties

Controls in VB allow creating graphical user interface (GUI) objects on forms. Common controls include text boxes, list boxes, and combo boxes. Text boxes allow entering text, list boxes display vertical lists, and combo boxes combine a text box and drop down list. Combo boxes have three styles: drop down combo, simple combo, and drop down list.

Uploaded by

Huidrom Sharat
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Q21. What do you mean by control in VB6.

In Visual Basic, the tool you use to create objects on a Visual Basic form. Controls are selected from the Toolbox and then used to draw objects on the form with the mouse pointer. It's key to realize that the control is just the tool used to create GUI objects, not the object itself. Q22. Explain deference between a data control and data-bound control. Ans: Using data control is a two-step process. First you place a data control on a form and set the properties to link it to a database file and table Data control generally links one form with one table. Prefix of data control is dat. You create the controls, such as labelsand text boxes, to display the actual data. Each control is a bound to particular field in the table. In this example the label is called a data bound control and automatically displays the contents of bound field when the project runs. If you want to have data-bound controls on second form, you must place a data control on that form. For databound control prefix depends upon the control which you are using. Data control to work you need to set some properties to connect with database like connect property, database name property, record source property. To display data on the data-bound control that you are using like labels or textboxes. You need set its data source property and data field name which is column name form the table.

Q23. What is text box control? What are the basic properties of a text box control?

1) TextBox controls offer a natural way for users to enter a value in our program. For this reason, they tend to be the most frequently used controls in the majority of Windows applications. Property/ Method Properties Enabled Index Locked MaxLength MousePointer Multiline PasswordChar ScrollBars Text ToolTipIndex Visible Method SetFocus Event procedures Change Click GotFocus LostFocus KeyDown KeyUp Action happens when the TextBox changes Action happens when the TextBox is clicked Action happens when the TextBox receives the active focus Action happens when the TextBox loses it focus Called when a key is pressed while the TextBox has the focus Called when a key is released while the TextBox has the focus Transfers focus to the TextBox specifies whether user can interact with this control or not Specifies the control array index If this control is set to True user can use it else if this control is set to false the control cannot be used Specifies the maximum number of characters to be input. Default value is set to 0 that means user can input any number of characters Using this we can set the shape of the mouse pointer when over a TextBox By setting this property to True user can have more than one line in the TextBox This is to specify mask character to be displayed in the TextBox This to set either the vertical scrollbars or horizontal scrollbars to make appear in the TextBox. User can also set it to both vertical and horizontal. This property is used with the Multiline property. Specifies the text to be displayed in the TextBox at runtime This is used to display what text is displayed or in the control By setting this user can make the Textbox control visible or invisible at runtime Description

Q24. Why VB is called Event-Driven programming language?

In traditional or procedural application, the application itself determines which portion of code is to be executed and in what sequence. Generally execution starts with the 1st line of code and follow the coding sequence define in the application. Whereas application written in VB are Event-Driven. In an event-driven application the code doesnt follow a predetermined path rather it execute different code sections in response to events. Event can be triggered by users action, by message from system, other applications or even from the application itself. The sequences of these events determine the order in which the code execute and associated with the objects of application. They either act on an object or are triggered by an object to control the flow of execution when it is running. That is why VB called Event-Driven programming language.

Q25. Why is a form considered a container control? An application's object is programmatically referred to as a parent when it can host, hold, or carry other objects. For this reason, such a window is also referred to as a container. So a form can be consider as a container because it can host many other controls The most common and the most widely used container is the form. As mentioned already, there are two categories of controls: parents and children:

Parent: A parent control "carries", "holds", or hosts the controls positioned on it. When a parent is created, made active, or made visible, it gives existence and visibility to its controls. When a parent gets hidden, it also hides its controls Child: A window is referred to as child when its existence, its visibility, and its availability depend on another window referred to as its parent. Except for the forms, all of the Windows controls you will use in your applications are child controls and they must be parented by another control.

Q26. Differentiate between MDI and SDI. i) SDI can load only 1 document at a time, however it can have multiple views in the same window using splitter windows property. Example is a notepad in windows. An MDI application has multiple child windows, each of which corresponds to an individual document. Microsoft Word is a good example of an MDI application. ii) With SDI option all the IDE windows are free to be moved anywhere on screen as long as Visual Basic is in the current application. With the MDI option all the IDE windows are contained within a single resizable parent window.

Q27. What is a purpose of image control and how can it be created ? Ans. An image control holds a picture. You can set an image picture property to file with an extension of .bmp,.GIF, .JPEG etc. First place the image control on a form and then select its picture property in the properties window. Click on the properties button to display load picture dialog box where you can select a filename. You can use any picture file ( with the property format ) that you have available. Set the Stretch property of image control to true to make the picture enlarge to filled the control .You can set the visible property to false to make the image disappear. The letter prefix for naming an image is img. For Example, to make an image invisible at run time , use this code statement: imgLogo . Visible = False

Q28. Find the differences between two dates using function. We use datediff() function to find out the defference between two dates. Ex: datediff(d,12/09/10,12/12/10) We evaluate to 3 days.

Q29. What is a listBox and ComboBox? Ans ListBox : ListBox present a list of choices that are displayed vertically in single column, if number of items exist the value can be displayed scrollbar automatically appear on control. ListBox have list property contain list or item to display. To add the item at design time, click on list property & add item, press ctrl + enter after adding each item. To add item at runtime to AddItem method is used. Syntax is as following : object.AddItem item, index The item argument string that represents text to add to the list . The index argument is an integer than indicated when in list to add the new item. ComboBox : A combobox control is combination of textbox and listbox. This control enables user to select either by typing in the text into combobox or by selecting items from the list. The combobox controls has three different style that can be set . a) Drop down combo (style 0) b) Simple combo (style 1) c) Drop down list (style 2)

Q30. Name and describe the three styles of combobox. Ans Combobox: A combobox control is combination of textbox and listbox. This control enables user to select either by typing in the text into combobox or by selecting items from the list. The combobox controls has three different style that can be set . a) Drop down combo (style 0) b) Simple combo (style 1) c) Drop down list (style 2)

a)Drop down combo : It first appears as only an editable area with down arrow button to drop down list portion with this style. We can either type text into text portion which is an editable area or select a value from drop down list. The list portion status hidden until the user clicks down arrow button to drop down list portion. b)Simple combo: This style looks like listbox setting directory underneath a textbox. The listbox , which is below textbox which is always visible showing an item present in it. Scrollbar display decides the list if there are to many item to display in listbox area. So important thing is , list is always present below textbox. Hence there no downward arrow button which are used to open a list, in case of drop down combo. c)Drop down list Combo: The drop down list combobox terms combobox into drop down listbox at run time , the control looks like drop down combobox. The user click on down arrow view list. Main difference between drop down combo & drop down list combo are editable are in the drop down list disable i.e. means user can only select from item listed in portion of listbox of the combobox and he cant type and item in the next or edit area of the combobox.

You might also like