Home

How to copy and paste from the Windows clipboard

In this VB.Net Tutorial/Code Example I’m going to show you how to copy text to the Windows clipboard and then get text from the Windows clipboard again. Public Class Clipboard ''' <summary> ''' This method deals with putting text into the clipboard ''' </summary> ''' <param name="textToCopy">The text to be put ...

Read more

Check whether an instance of a form is open

In this VB.Net Tutorial/Code Example I’ll be showing you how to check to see whether there is an instance of a form open in your application. ''' <summary> ''' This method deals with checking to see whether a particular form is open ''' </summary> ''' <param name="formName">The name of the form that you are looking for</par...

Read more

How to get all instances of a form

Because in VB.Net you’re able to have multiple instances of a form, sometimes you want to be able to get a list of all of the instances of that form that are open, the following function will do this for you. ''' <summary> ''' This method deals with getting all the instances of a form ''' </summary> ''' <param name="formName">...

Read more

Check whether the application is currently being debugged

If you want to know whether the application is currently being debugged you can use the following code; Public Shared ReadOnly Property DebugMode() As Boolean Get Dim rtn As Boolean = False #If DEBUG Then rtn = True #End If Return rtn End Get End Property The part of code in the if statement will only be exec...

Read more

Check whether the current user is an administrator

An extremely simple way to check whether the currently logged in user has administrative rights on the local machine; Public Shared ReadOnly Property IsUserAdmin() As Boolean     Get         Return My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator)     End Get End Property

Read more

Stop someone from pasting into a TextBox

This article goes hand in hand with my article called “Restrict characters entered into textbox” and I shall use pretty much the same example as I used before. If you wanted to stop a user from entering anything but numbers into a TextBox you could use the method described in the previous article, but the one problem with that is that the user ...

Read more

Using a ListView as a multi column ListBox

In order for you to get the ListView to act like a multicolumn ListBox you need to set the following properties Property Name New Value Reason FullRowSelect True If FullRowSelect is left on its default value of False then when a user selects a row then it will only be a single column ...

Read more