Category Archive for: Working with Forms

Manual Drag

Now we’ll see how to drag editable controls (such as TextBox controls) without sacrificing the control’s editing features. To initiate a drag operation manually, call the Drag method. Calling the Drag method for a control is equivalent to set- . ting its DragMode property to I’-Automatic for as long as the control is being dragged. After the control is…

Read More →

The FileList Control’s DragDrop Event Handler

There are a few more lines of code here because the program must figure out the control that initiated the drag-and-drop operation and remove the selected item from the corresponding list. Again, the code uses the form’s ActiveControl property to figure out where the item came from. You may notice that the DragLabel control doesn’t become visible before…

Read More →

The DragMode Property

Nearly all controls have a DragMode property, which determines whether a control can be dragged with the mouse. The DragMode property can have one of the following settings; • O-Manual Drag operations must be initiated from within the code. • Automatic The user can drag the control with th.e mouse. When you set a control’s DragMode property to…

Read More →

Building Dynamic Forms at Runtime

There are situations when you won’t know in advance how many instances of given control may be requirei:l on a Form. This isn’t very common, but if you’ writing a data entry application and you want .to work with many tables of a database, you’ll have to be especially creative. Since every table consists of  fields, it will…

Read More →

Programming Menu Commands

Menu commands are similar to controls. They have certain properties that you can manipulate from within your code, and they recognize a single event, the Click event. If you select a menu command at design: tiine, Visual Basic opens the code for the Click event in the Code window. The name of the event handler for the Click event…

Read More →

The Aqivate and Deactivate Events

When more than one Form is displayed, the user can switch from one t~·the other with the mouse or by pressing Alt+Tab. Each time a Form is activated, th.e Activate event takes place. The Forms application uses the Activate event to set the Form’s I caption to a message rdicciting that this is the current Form: Private Sub…

Read More →

The Do Events Statement

As mentioned earlier, Wmdows doesn’t deal with the display if it’s busy executing code. ‘In other words, the update of the display has a low priority in the Windows “to do” list. ‘The code that implements the artificial delay in the loading of a’ Form is a tight loop. While it’s executing, it takes over the application, You…

Read More →

VB6 at Work: The FormLoad Project

By default, Visual Basic loads and displays the first Form of the project. If the loading process takes more’ than a second, the user simply has to wait. The Form- Load application demonstrates a technique for handling slow-loading Forms. You can’t shorten the load time, but you can improve the subjective delay, which is the delay perceived by the…

Read More →

The Start-Up form .

A typical application has more than a single Form. When an application starts, the main Form is loaded. You can control which Form is initially loaded by setting the start-up object in the Project Properties window,To open this dialog box, choose Project> Project Properties. IMG By default, Visual Basic suggests the name of the first Form it created…

Read More →

Working with Forms

In Visual Basic, the Form is the container for all the controls that make up the user interface. When a Visual Basic application is executing, each window it displays on the Desktop is a Form. In previous chapters, we used Forms as containers on which we placed the elements of the user interface: Now, we’ll look at Forms and…

Read More →

Back to Top