Tag Archives: vb.net code

How to convert HTML Color code to RGB color code

The following VB.Net code converts HTML color code to equivalent RGB color code. Module modMain Public Function ConvertHTMLToRGBColor(ByVal sHtmlColor As String) As Color ‘Remove the # if exists sHtmlColor = sHtmlColor.Replace(“#”, “”) Return Color.FromArgb(System.Convert.ToInt32(sHtmlColor.Substring(0, 2), 16), System.Convert.ToInt32(sHtmlColor.Substring(2, 2), 16), System.Convert.ToInt32(sHtmlColor.Substring(4, … Continue reading

Posted in VB.Net | Tagged .net code, convert HTML color code to RGB color code, html color, rgb color, vb.net code | Leave a comment

How to Check whether the application/process is running or not by passing the process name

Here is the awesome VB.Net code to check whether the application/process is running or not by passing the process name: Module modMain Sub Main() ‘Check whether acrobat is running or not If IsProcessRunning(“acrobat”) Then Console.WriteLine(“Yes. Acrobat is running”) Else Console.WriteLine(“No. … Continue reading

Posted in System & API, VB.Net | Tagged application running, c#.net .Net, How to, How to check application running, VB.Net, vb.net code | Leave a comment

How to Write/Create Text file?

Here is the simplest way of creating a new Text file. If the file already exists, then the text will be appended to the existing file. My.Computer.FileSystem.WriteAllText(“Full_Path_of_Your_Text_File.txt”,”Text you would like to write to text file”, True) The above piece of … Continue reading

Posted in .Net, VB.Net | Tagged .net code, create text file, dotnet code, text file, vb.net code, write text file, write text to a flat file | 1 Comment

How to minimize a window by passing the process name

The VB.Net code posted on this page minimizes the window for the given process name. Module modMain #Region “Declarations for Minimizing Windows” Private Declare Function ShowWindow Lib “user32.dll” (ByVal hWnd As IntPtr, ByVal nCmdShow As SHOW_WINDOW) As Boolean Private Enum … Continue reading

Posted in VB.Net | Tagged c#.net .Net, How to, How to minimize a window, minimize window, VB.Net, vb.net code | Leave a comment

How to check for previous instances in .Net?

There are some instances you may want to disallow the user to launch your program if it is already running. There are few ways to check whether the previous instance of your application is already running. Here is one of … Continue reading

Posted in C#.Net, VB.Net | Tagged c#.net .Net, How to, How to check previous instance, previous instance, VB.Net, vb.net code | Leave a comment