Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
Search the Tips

Forms - Page 3

41-60 of 389     Previous     Next
Tiling a Background Picture Across an Entire Form
by Andreas Hillqvist
Tiling a background picture across the entire form can be done with the following lines of ...
ExplodeForm - Show a form with an explode effect
by Marco Bellinaso
Show a form with an explosion effect. the lNumSteps parameter is the number of steps to increase the form size from 0 to the original size the lStepDuration argument is the number of milliseconds between each step Example: Private Sub Form_Load() ExplodeForm Me, 20, 2 End Sub
MakeModalForm - Make a modeless form modal
by Francesco Balena
make a modeless form modal this procedure should be called by passing TRUE in the 2nd argument to make the form modal, and called again with FALSE in the 2nd argument when the form is being unloaded. Private Sub Form_Load() MakeModalForm Me, True End Sub Private Sub Form_Unload(Cancel ...
OptionButtonIndex - Determine the selected OptionButton in a control array
by Francesco Balena
get the index of the active OptionButton in an array
RemoveCloseMenuItem - Remove the Close button and command from a form
by Marco Bellinaso
Remove the Close menu item and disable the Close button from a window
Making a Form Scrollable
by Andreas Hillqvist
This is one of the simplest, but most powerful, ways to make a form scrollable. This method automatically disables or enables scrollbars according to the size of the area in relation to the form.
Determine the current line in a multiline TextBox control
by Marco Bellinaso
You can determine the line where the caret is in a multiline TextBox control by sending the control a EM_LINEFROMCHAR message, as follows: Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As ...
Avoid beeps on forms without a default button
by Francesco Balena
If a form contains one CommandButton control whose Default property is set to True, the Enter key activates the CommandButton. If the form doesn't contain any default CommandButton control, however, pressing the Enter key when the focus is inside a TextBox control (and a few other controls as ...
Change a CheckBox or OptionButton style at runtime
by Francesco Balena
Visual Basic doesn't let you change the Style property of a CheckBox or an OptionButton control at runtime. However, you can easily do it by manipulating the control's style bit, with the SetWindowLong API function. Here's a routine that does the trick: Private Declare Function ...
Provide better visual feedback for disabled TextBox and ComboBox controls
by Francesco Balena
When you disable a control, VB grays its contents. However, often this action goes unnoticed by the end users. Here's a routine that changes the control's BackColor property in addition to changing its Enabled property: ' enable/disable a textbox or a combobox ' (also changes its ...
ComboBoxSetHeight - Set a new height for the list portion of a ComboBox control
by Francesco Balena
Set a new height for the list area of a ComboBox control NEWHEIGHT is measured in pixels
Determine when a ComboBox's area is being closed
by Francesco Balena
The ComboBox control exposes the DropDown event, that lets you determine when its list area is being opened. However, VB doesn't offer any simple way to understand when the list area is being closed. You can achieve this by intercepting the WM_COMMAND message that the ComboBox control sends to ...
Ensure that a form's TextBox and ComboBox controls have same height
by Francesco Balena
In general you don't have any control on a ComboBox's Height property, because it is determined automatically by VB depending on the font used for the ComboBox control. If you have a form that contains both TextBox and ComboBox controls, you should ensure that all your single-line TextBox ...
Add an horizontal scrollbar to a ListBox control
by Francesco Balena
By default, VB ListBox controls don't display an horizontal scrollbar, so if the items you add to the controls are wider than the control's Width, the end user isn't able to read them in their entirety. Adding an horizontal scrollbar to a ListBox control is easy, however. You only have to ...
ListBoxItemFromPoint - The index of a ListBox item at given coordinates
by Francesco Balena
Return the index of a ListBox item at given coordinates X and Y are in pixels and relative to the ListBox's upperleft corner This is similar to the HitTest method of the ListView control Here an example that shows the index of the item under the cursor Private Sub List1_MouseMove(Button As ...
IsFormModal - Determines whether a form is modal
by Francesco Balena
Return True if the form is modal Note: if an application has only one visible form, this function considers it as modal
ListBoxFindString - Search an item in a ListBox or ComboBox control
by Francesco Balena
Find a string in a ListBox or ComboBox control Returns the index of the match, or -1 if not found. The third argument is the index *after* which to start the search (first item if omitted). If the fourth argument is True it searches for an exact match.
Quickly find which OptionButton is selected
by Leigh Pointer
Often OptionButton controls are arranged in control arrays. To quickly find the index of the only selected OptionButton control you can use the following code: ' assumes that the control array contains three OptionButton controls intSelected = Option(0).Value * 0 - Option(1).Value * ...
SetMenuBitmap - Add a bitmap to a menu item
by Francesco Balena
add a bitmap to a menu item The first two arguments can be the Picture property of a PictureBox control, or the result from a LoadPicture function. If CheckedPicture is Nothing, the first Picture is used both for the unchecked and checked status. To remove a menu picture, use Nothing for ...
Use a ListBox as a poor man's grid
by Francesco Balena
You can easily create columns of data in a ListBox control by setting its tab stop at appropriate positions. This way, you can use a ListBox control as a sort of grid control with (very) limited functionality, but without using third-party controls. You can set ListBox's tab stop by ...
41-60 of 389     Previous     Next
Sitemap