|
|
|
|
InputBox - A .NET replacement for this VB6 function
|
Total Hit (3467) |
«Code LangId=2»' Create an InputBox like the one of VB6. You can define the dialog's title,
' question and default value.
' Example: MessageBox.Show(InputDialog.InputBox("Type your name:", "Test",
' "Marco"))
Public Class InputDialog
Inherits System.Windows.Forms.Form
#Region " Windo
....Read More |
Rating
|
|
|
InsertImageIntoRtb - Inserting an image into a RichTextBox
|
Total Hit (4856) |
«Code LangId=2»
' Insert an image into a RichTextBox, in the current position
'
' This version takes in input the target RichTextBox and the path of the image
' to insert
' Example: InsertImageIntoRtb(RichTextBox1, "C:\test.jpg")
Sub InsertImageIntoRtb(ByVal rtb As RichTextBox, ByVal imgPat
....Read More |
Rating
|
|
|
Pasting the text in the Clipboard into a RichTextBox
|
Total Hit (3469) |
«Code LangId=2»' Paste the text currently in the Clipboard into the specified RichTextBox
' Example: PasteIntoRichTextBox (richTextBox1)
Public Sub PasteIntoRichTextBox(ByVal rtb As RichTextBox)
' get the data currently in the Clipboard
Dim data As IDataObject = Clipboard.GetDataObject
....Read More |
Rating
|
|
|
|
|
|
|
|
|
|
|
ImplodeForm - Hiding a form with an implosion effect
|
Total Hit (2829) |
«Code LangId=2»' 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 My
....Read More |
Rating
|
|
|
MoveListboxItem - Moving an item of a listbox to another index
|
Total Hit (2564) |
«Code LangId=2»
' Moves an item of a listbox to another index
' If FROMINDEX = -1 then it moves the current highlighted item
'
' Example:
' ' move up the selected item
' MoveListboxItem(ListBox1, -1, ListBox1.SelectedIndex - 1)
' ' move down the selected item
' MoveListboxItem(ListB
....Read More |
Rating
|
|
|
Adding styles to the font of the selected text of a RichTextBox
|
Total Hit (2100) |
«Code LangId=2»' Add a style to the selection of a RichTextBox,
' without deleting the current styles that may be already
' present in the selection or in portions of it
'
' Example: AddFontStyle(richTextBox1, FontStyle.Bold)
Public Sub AddFontStyle(ByVal rtb As RichTextBox, _
ByVal styl
....Read More |
Rating
|
|
|
|
|
|
|
Ensuring that a style is supported by a font family
|
Total Hit (2604) |
«Code LangId=2»' 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(richTextB
....Read More |
Rating
|
|
|
|
Creating owner drawn menu items to simulate a color picker
|
Total Hit (3637) |
«Code LangId=2»' 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
....Read More |
Rating
|
|
|
ExplodeForm - Showing a form with an explosion effect
|
Total Hit (3985) |
«Code LangId=2»
' Show a form with an explosion effect.
' the numSteps parameter is the number of steps to increase the form size from
' 0 to the original size
' the stepDuration argument is the number of milliseconds between each step
' Example:
' Private Sub Form1_Activated(...) Handles
....Read More |
Rating
|
|
|
|
|
SearchFileInDirTree - Searches a file on a directory tree
|
Total Hit (2862) |
«Code LangId=2»
<System.Runtime.InteropServices.DllImport("imagehlp.dll")> Shared Function _
SearchTreeForFile(ByVal rootPath As String, ByVal inputPathName As String, _
ByVal outputPathBuffer As System.Text.StringBuilder) As Boolean
End Function
' Returns the complete path+name of th
....Read More |
Rating
|
|
|
SearchFileOnPath - Searching a file on the system
|
Total Hit (2704) |
«Code LangId=2»<System.Runtime.InteropServices.DllImport("kernel32")> Shared Function _
SearchPath(ByVal tartPath As String, ByVal fileName As String, _
ByVal extension As String, ByVal bufferLength As Integer, _
ByVal buffer As System.Text.StringBuilder, ByVal filePart As String) As
....Read More |
Rating
|
|
|