Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > Web Development > Web Forms

Web Forms - Page 2

21-40 of 400     Previous     Next
CenterCaptionInAdodc - Center a caption on an ADODC Data control
by Bill O'Neil
Center caption in Adodc control Input: frmForm - Form Adodc contol in on datAdodc - Adodc control sCaption - Caption text Output: Padded Caption text
GetSelectedOption - Get the selected element in an OptionButton control array
by Wim De Smet
Determine which element of an option button control array was selected Returns -1 if no control has been selected Use : OptSelected = GetSelectedOption(Option1)
Allow Interval Greater Than Timer Controls
by Alex Whyte
When you need a timer for a larger interval than the Timer control allows, insert this code into a BAS module. The procedure starts when the timer interval has ...
Use the Erl Function to Debug
by Aaron Crandall
When you
Detect whether a field on a form has been edited
by Francesco Balena
Many tip & trick collections report that you can learn if the contents of a text box has been modified by sending a EM_GETMODIFY message to the control. Actually, getting this information is much more simple. Just test the DataChange property: if non zero the field has been modified since the ...
Determine whether a control has a scrollbar
by Francesco Balena
There is no built-in VB function that lets you know whether a control - such as a ListBox - is currently displaying a vertical scrollbar. Here's a pair of functions that check the control's style bits and return a Boolean that tells if a vertical or horizontal scrollbar is visible:
Extended user interface for combo boxes
by Francesco Balena
Apart from the different kind of combo boxes you can obtain by manipulating the Style property, another feature is made available by Windows when dealing with combo box controls, the so-called extended user interface. With standard combo box controls, the list portion stays invisible until the ...
Incremental searches within list boxes
by Francesco Balena
The DBList and DBCombo controls expose a MatchEntry property, that - when set to True - permits to perform quick incremental searches by simply typing the searched sequence of characters. If MatchEntry is set to False, any time the user presses a key, the next item that begins with that ...
Move focus with Up and Down keys
by Francesco Balena
In all standard controls, Up and Down arrow keys move the focus on the previous or next control in the TabIndex order, respectively. This contrasts with text boxes, where these keys move the caret on the adjacent character, which you can achieve in a more natural way using the Left and Right ...
Mutually exclusive list boxes
by Francesco Balena
Many Windows programs use two adjacent list box controls to let the user select a number of items from a list of available values; such list boxes are mutually exclusive, in the sense that a given item always appear in the list box on the left (available items) or in the list box on the right ...
Smart Tab key processing in multiline TextBox controls
by Francesco Balena
The only way for a Tab key to insert a tab character in a multiline text box is that the text box is the only control on the form, or at least the only control whose TabStop property is set to True. Otherwise, pressing the Tab key you simply move the focus to another control on the form.
Using Enter to move to next field
by Francesco Balena
Most MsDos programs used the Enter key to move from one field to the next one. You can easily simulate this behavior by setting the form's KeyPreview property to True and writing this code in the Form_KeyPress event: Sub Form_KeyPress (KeyAscii As Integer) If KeyAscii = 13 Then ...
Use Refresh, not DoEvents
by Francesco Balena
The DoEvent statement should be used only to give other portions of your program to be reactive to the end user's actions. Instead, many VB developers use it to force a repaint of a form or some of its controls. This means adding a lot of overhead to your code, which you can avoid by using the ...
Making a form appear as if it is disabled
by Francesco Balena
By changing the WS_CHILD style bit of a window, you can make it appear as if it is disabled, even if the form is fully active and functional. These are the statements you need: Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex ...
Retrieve a Parent Directory From a Path
by Andreas Hillqvist
You can retrieve the parent directory from a path by identifying the first and last backslash. The start position for the first backslash should be 3 in order for it to handle UNC paths. By ...
DrawBorder - Draw a raised/bump/etched/sunken border
by Marco Bellinaso
draw a raised/bump/etched/sunken border at given coordinates
Cut, copy, and paste using API functions
by Francesco Balena
Copying and pasting text and images programmatically isn't difficult at all, using the methods of the Clipboard object. However, implementing a generic Edit menu that copies and pastes the highlighted contents of whatever control is the selected control is often cumberson. For example, ...
Get a reference to a form given its name
by Francesco Balena
In some cases you might want to activate a form given its name, but VB doesn't let you do it directly. However, it is easy to create a function that does it by iterating over all the forms in the current project: ' retrieve a reference to a form given its name ' if there are multiple ...
Unload a form with shrinking effect
by Francesco Balena
A simple way to add some pizazz to your forms is by minimizing them and then closing them, instead of making them disapper istantaneously. Just try this code: Private Sub Form_Unload(Cancel As Integer) Me.WindowState = vbMinimized End Sub
Save and reload form settings from system registry
by Francesco Balena
You can put VB's registry functions to good use by creating a few reusable routines that save, reload, and delete size and state of a form in your program. ' Save form settings Function SaveFormSettings(ByVal AppName As String, frm As Object) SaveSetting AppName, frm.Name, ...
21-40 of 400     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date