Posts

Working with Date and Time VB.Net

VB.NET's DateTime structure represents an instant in time which is commonly expressed as a particular date and time of the day. It's a part of your daily life while creating your applications which makes it easy for you to manipulate system's date and time. In this article I'll be showing you the commonly used properties and methods and example usage of the Date and Time in VB.Net. Use the Date data type to contain date values, time values, or date and time values. The default value of Date is 0:00:00 (midnight) on January 1, 0001. You can get the current date and time from the DateAndTime class. DateTime Properties The table below shows some of the commonly used properties of the DateTime Structure: Property Description Date Gets the date component of this instance. Day Gets the day of the month represented by this instance. DayOfWeek Gets the day of the week represented by this instance. DayOfYear Gets the day of the year represented by this instance. H...

Commonly Used VBA Statements for Excel VBA Programming

Image
The following table shows a list of commonly used VBA statements that might be useful when creating macros for your Excel projects. To know more information about each statement, consult Excel’s Help system by pressing "F1".

Remove and Replace All Characters in Microsoft Excel using VBA

The following FindandReplace() function allows you to replace or remove specific text and characters you want in Microsoft Excel. Just copy the code below on your VBA code class or module. Sub FindandReplace(FindWhat as String, ReplaceWith as String)         Cells.Replace What:=FindWhat, Replacement:=ReplaceWith, LookAt:=xlPart, SearchOrder:= _         xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False End Sub Put this in your Sub or Function. To Replace several text with new text. FindandReplace "OldText", "NewText" To remove several text just leave the second argument blank. FindandReplace "OldText", ""

How to Minimize/Send an App Icon to System Tray in Visual Basic 6

The following code snippet allows to manipulate the system tray by adding your apps icon when you minimize the form and restore when you double click on the app's icon on the system tray area. Option Explicit Public Type NOTIFYICONDATA cbSize As Long hWnd As Long uId As Long uFlags As Long uCallBackMessage As Long hIcon As Long szTip As String * 64 End Type Public Const NIM_ADD = &H0 Public Const NIM_MODIFY = &H1 Public Const NIM_DELETE = &H2 Public Const WM_MOUSEMOVE = &H200 Public Const NIF_MESSAGE = &H1 Public Const NIF_ICON = &H2 Public Const NIF_TIP = &H4 Public Const WM_LBUTTONDBLCLK = &H203 'Double-click Public Const WM_LBUTTONDOWN = &H201 'Button down Public Const WM_LBUTTONUP = &H202 'Button up Public Const WM_RBUTTONDBLCLK = &H206 'Double-click Public Const WM_RBUTTONDOWN = &H204 'Button down Public Const WM_RBUTTONUP = &H205 'Button up Public Declare Function Shel...

How to Set Windows Form Always on Top of Other Applications in VB6

The following code snippets allows to set Windows Form Always on Top of Other applications in Visual Basic 6.0. Public Const SWP_NOMOVE = 2 Public Const SWP_NOSIZE = 1 Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE Public Const HWND_TOPMOST = -1 Public Const HWND_NOTOPMOST = -2 Declare Function SetWindowPos Lib "user32" _ (ByVal hWnd As Long, _ ByVal hWndInsertAfter As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal cx As Long, _ ByVal cy As Long, _ ByVal wFlags As Long) As Long The following SetTopMostWindow() function takes two parameters as follows:       hWnd : the window handle       Topmost : It is either True to set the on top or False if Not. Public Function SetTopMostWindow(hWnd As Long, Topmost As Boolean) As Long If Topmost = True Then 'Make the window topmost SetTopMostWindow = SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS) Else SetTopMostWindow = SetWindowPos(hW...

How to Make Windows Form Transparent using Visual Basic 6/VB6

The following code snippets allows you to make windows form transparent using VB6. In a standard module, copy and paste the following declarations and function. [ Module1.bas ] Option Explicit Const LWA_COLORKEY = 1 Const LWA_ALPHA = 2 Const LWA_BOTH = 3 Const WS_EX_LAYERED = &H80000 Const GWL_EXSTYLE = -20 Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal color As Long, ByVal x As Byte, ByVal alpha As Long) As Boolean Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAP...

Internet Connection Speed Booster

Image
Internet Speed Booster is a simple tool that can be used to reset internet connection, flush DNS resolver cache, and renew dynamic IP addresses. This tool allows online and massive gamers to feel like a boss in the games arena. This tool primarily solves the problem if you're having limited connectivity or frequent disconnection from the internet. Internet Speed Booster is just right for you for FREE. Internet Speed Booster is available for free download .