Lin's Blog
|
  • Zh-Tw
  • Ja
  • Posts
  • Categories
  • About

How to Write Functions in VB (Major Error Correction)

Today I’m going to teach everyone how to write their own functions. First, you need to know the syntax for functions. Also, you must place your own functions at the very bottom of the program. Syntax: Function FunctionName(Byval Parameter As ParameterType,Byval Parameter As ParameterType) FunctionName = (what the function does) End Function A quick explanation: you can name the function whatever you like, and you don’t need to wrap the name in double quotes. Parameters are optional. Whether you need them depends on what the function does. If the function needs to receive values, you have to set them up. ...

Programming
#VB
April 19, 2009 · 2 min

Windows Edit Tool: A System Tweaking Utility Every Power User and MIS Admin Needs!

Windows Edit Tool has many built-in tweaks that let you configure your computer’s registry settings. The features I personally like best in Windows Edit Tool are automatic logon for XP accounts and its basic optimization functions. I’ve tested these myself and they work fine, since they only make simple changes to the registry. Windows Edit Tool also has a drive-hiding feature. Put simply, if you’ve downloaded some things you’d rather keep private~ you can store them on a hidden drive so the wrong people won’t see them. ...

Software
#Windows
April 18, 2009 · 1 min

VB Syntax for Showing and Closing Forms

 In VB, if you want to switch to another form, you can use the show() syntax. The syntax is as follows: FormName.show() FormName is the name of the form you want to switch to. For example, if you want to switch to a form called form2, enter form2.show(). If you want to open a new form and then close the old one, the syntax is: FormName.close() To close the form itself, enter me.close() ' means “close myself” This syntax can also be used to close other forms. The only condition is that the form you close must belong to your own program (well, obviously~~)

Programming
#VB
April 17, 2009 · 1 min

[VB] Replacing Text with the Replace Function

If you want to replace part of a string with something else in VB, you can use the Replace function. The syntax is as follows: StringName.replace(A,B) StringName is the name of the variable where your text is stored. For example, say you store 123456 in S1. Then you enter S1.replace(A,B) ...

Programming
#VB
April 17, 2009 · 1 min

Keep a Window Always on Top with SetWindowPos

First, add a Timer control to the program. Enable the timer (named timer1). Set its interval to 100. Then enter the following code (paste it over the existing code, replacing what is already there). Option Strict Off Option Explicit On Public Class Form1 Inherits System.Windows.Forms.Form Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer Dim IntR As Object Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Top = 0 Me.Left = 0 Me.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width Me.Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick IntR = SetWindowPos(Me.Handle.ToInt32, -1, 0, 0, 0, 0, 3) End Sub End Class

Programming
#VB
February 14, 2009 · 1 min

How to Fix the "0x000000 Memory Cannot Be Read" Error

Recently I keep running into a problem while playing games. Programs sometimes show an error. The message says “0x000000 memory cannot be Read”. I saw in a book that it indicates the memory read error location. But the book didn’t say what to do about it. So I looked online. One method I found online is to use a cmd command to re-register the DLL files. ...

Hardware
#Windows
February 7, 2009 · 1 min

VB Keyboard Simulation

The keyboard is still one of the most important input devices for using a computer. Even in today’s mouse-dominated world, many programs still can’t do without it. But repetitive, tedious keyboard operations can wear people out, so people came up with the idea of using a program to press keys in their place. That saves a lot of effort, and it is exactly what Keyboard Genie (Anjian Jingling) does. So how can we use VB to write a program with similar functionality? Let’s first look at how Windows responds to keyboard events. ...

Programming
#VB
November 26, 2008 · 24 min
« Prev 

Categories

All Programming AI SRE Life Hardware Software Blog Travel Web Apps Games Security
© 2026 Lin's Blog · Powered by Hugo & PaperMod