Login | Register   
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
Tip Bank > Web Development > Web Forms

Web Forms - Page 3

41-60 of 398     Previous     Next
Read and modify a TextBox control's formatting rectangle
by Francesco Balena
By sending appropriate messages to a multi-line TextBox control you can read and modify its formatting rectangle - that is, the inner portion of the control where the user can type. Modifying the size and position of this area can be useful, for example, to leave a left margin where you can add ...
ComboBoxGetDroppedControlRect - Get the size of a ComboBox dropped rectangle
by Francesco Balena
Return the size and position of the drop-down list rectangle of a ComboBox control.
Ensure that a TextBox caret is visible
by Francesco Balena
Setting a multiline TextBox's SelStart property doesn't ensure that the insertion point (the caret) is visible. You can achieve this by sending the control an appropriate message: Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As ...
Set tab stop positions for a multiline TextBox control
by Francesco Balena
By default, multiline TextBox controls insert a tab stop position every 8 characters; in other words, if you press the Ctrl+Tab key while the focus is inside a multiline TextBox control, the caret advances to position 8,16,24, etc. (If the TextBox is the only control on the form that can ...
TextBoxGetLine - Return a single line in a multiline TextBox control
by Francesco Balena
Return the specified line in a multiline TextBox control.
TextBoxGetLineColumn - Get caret position in a multiline TextBox control
by Francesco Balena
Get the line/column coordinates of a given character (both are zero-based). If charIndex is negative, it returns the coordinates of the caret
TextBoxGetLines - Get an array with individual lines in a TextBox control
by Francesco Balena
Return an array with all the lines in the control. If the second optional argument is True, the hard CR-LFs are preserved (hard CR-LFs are those inserted by the user, soft CRLFs are those inserted automatically to wrap long lines)
TextBoxScroll - Programmatically scroll a multi-line TextBox control
by Francesco Balena
Scroll the contents of the control. Positive values scroll left and up, negative values scroll right and down. IMPORTANT: you can only scroll TextBox control to which the corresponding scrollbar (horizontal or vertical) is associated
Animating the Window on Showing or Hiding
by Sachin Nigam
You can easily add animation when showing or hiding a window using the AnimateWindow API. There are three types of animation: roll, slide, and alpha-blended fade. The declaration of API is like ...
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 ...
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 ...
41-60 of 398     Previous     Next
Sitemap