Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips

Forms - Page 4

61-80 of 469     Previous     Next
ImplodeForm - Hiding a form with an implosion effect
by Marco Bellinaso
Hiding a form with an implosion effect. the numSteps parameter is the number of steps to decrease the form size from the current size to 0 the stepDuration argument is the number of milliseconds between each step Example: Private Sub Form1_Closing(...) Handles MyBase.Closing
CountCheckedNodes - Retrieving the number of checked nodes in a treeview
by Marco Bellinaso
Return the number of checked nodes in the specified tree
Adding an image as an embedded resource, and loading it from code
by Marco Bellinaso
To add an image as an embedded resource in a Windows Forms application, add the image file to the project with Project | Add Existing Item. Then select the file in the Solution Explorer, go to the Properties Window, and set its Build Action property to Embedded Resource. At ...
Creating multiline tooltips
by Marco Bellinaso
In VB6 there was no easy way to create multiline tooltips for form controls, you necessarily had to resort to API tricks. And it was probably just not worth the effort. The good news is that doing this is straightforward in VB.NET! First add a Tooltip Provider control on the form to add the ...
Using multiple fields as value for the DropDownList control's items
by Audrey Peters
Being an avid Access Programmer I have been frustrated with the limitation of VB DropDownLists to using only 1 field as the value. I found a way to simulate/work around this behavior with concatenation of several database fields at the query level to be my columns(i.e. Select KeyId1 + '~' + ...
Execute a Temporary SQL Stored Procedure
by Parthasarathy Mandayam
If a user doesn
A cheap way to display files and hex data
by Francesco Balena
The .NET framework includes a ByteViewer control, that you can use on your own forms to display data stored in a Byte array or in a file. The ByteViewer control can't be added to the control Toolbox, though, so you must instantiate it through code only. ' IMPORTANT: this code requires ...
EnsureNodeIsVisible - Select a TreeView node and ensure it is visible
by Francesco Balena
select a treevide node and ensure it is visible by expanding all its parent nodes and bringing the node in the visible portion of the control
A New Look at the Select Case
by Michael C.
Who says the Select Case can evaluate only one statement? Try Select Case True instead of the If
Bind a DataGrid to a DataSet at design-time
by Francesco Balena
Binding a DataGrid - or any other data-aware control - to a DataSet or a DataTable at runtime isn't difficult: you just have to assign the DataTable to the DataGrid's DataSource property, as in: ' DS is the DataSet variable DataGrid1.DataSource = ds.Tables("Titles")
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
Map an enumerated value to a set of OptionButton controls
by Francesco Balena
In VB6 and previous version, displaying an enumerated value in a group of option buttons is quite simple, provided that the option buttons be grouped in a control array. VB.NET doesn't support control arrays, so you can't reuse the same simple coding techniques. However, you can prepare a ...
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)
Creating owner drawn menu items to simulate a color picker
by Marco Bellinaso
This class does the owner drawing of a MenuItem to draw a color box. The class inherits from MenuItem, thus the ColorMenuItem objects can be added to a parent MenuItem or a context menu as you normally do, and can also be mixed with other MenuItem items under the same parent item.
Ensuring that a style is supported by a font family
by Marco Bellinaso
Not all fonts support the same styles. This function takes in input a font family and a font style, and returns a font style which is safe for that particular font family, by removing the styles that are not supported Example: GetSafeStyleForFontFamily(richTextBox1.SelectionFont.
Hiding pages of a TabControl
by Marco Bellinaso
Sometimes you may need to hide or show some pages of a TabControl according to the information you want to show, basing on the currently logged-in user for example (users with low privileges won't be able to get all the information or to change records). To do this, you may attempt to add or ...
Setting the width of the last column of a ListView when the control is resized
by Marco Bellinaso
When you resize a ListView control (this happens automatically if the ListView is docked to the form, and the user resizes the form), it's nice to have the last column to be resized accordingly to cover the available space. To do this, handle the ListView's Resize control (in .NET any control ...
Copying the selected text of a RichTextBox text into the Clipboard
by Marco Bellinaso
Copy the RichTextBox's selected text into the Clipboard Example: CopyFromRichTextBox (richTextBox1)
Pasting the text in the Clipboard into a RichTextBox
by Marco Bellinaso
Paste the text currently in the Clipboard into the specified RichTextBox Example: PasteIntoRichTextBox (richTextBox1)
Setting the font family of the selected text of a RichTextBox
by Marco Bellinaso
Set the specified font to the selection of a RichTextBox Note: require GetSafeStyleForFontFamily Example: SetFontFamily(richTextBox1, "Times New Roman")
61-80 of 469     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date