1, if the process is too long and his party, can be for the profession?
The VB code is written to allow for the trip, as long as each other on the final character with a newline character "_" on it. For example:
Sub PicMove ()
Frm.Picture2.Left _ = Frm.Picture1.Left + 'with newline
Frm.Picture1.Width
End Sub
2, in the design of how the picture clear?
With your mouse, point of the picture, in the properties window, select Picture attributes, according to Del keys can be emptied picture.
3, Visual Basic Note how a longer code?
Notes VB code symbol is "Note:" as long as certain procedures added to the front line "Note:" Notes on the bank procedures. But if the code is a long time, his party and his party to give the impression that the Notes unbearable. VB itself provides this function in the main menu "View" option "toolbar", select Edit, VB will interface tool buttons in a row, including the hand-shaped icon button for the two buttons " Notes block set up "and" Notes to lift block. "
4, how to achieve a mouse moved forward tips on the small window?
VB has ToolTipText controls in each attribute, as long as the procedure can be a party.
For example: Label1.ToolTipText = "This is the Tip!."
5, how to obtain the software disk directory and run the command line parameters?
VB there are systems objects called App. App.Path is that the current software runtime. The command-line parameters stored in a system variables, called Command. Program statement is as follows:
Label1.Caption = App.Path
Command = $ Label2.Caption
6, I would like to show that the shape of the mouse replaced, how do?
VB provides systems and controls are generally MousePointer MouseIcon attributes. We can find their favorite *. ICO, CUR file *. achieve the procedures are as follows:
Screen.MousePointer = 99 'User mouse type
Screen.MouseIcon = LoadPicture ( "C: \ ABC \ 1.ICO") 'document read mouse icon
7, how to set up procedures for exports wrong?
On Error statement to procedural errors export processing. General there are two ways of handling:
1) errors encountered Jump to a trip to the implementation of procedures, On Error GoTo someline.
For example:
On Error GoTo ERR_LINE
...
Label1.Caption = "correct implementation"
ERR_LINE:
...
Label1.Caption = "wrong!"
2) have overlooked the mistake after mistake, and continue to implement, On Error Resume Next.
For example:
On Error Resume Next
...
Label1.Caption = "Regardless of the implementation must be wrong"
...
8, how to obtain keyboard input and judgement Ascii knock bond values?
KeyPreview form of the attributes set to True, and then Form_KeyPress incidents in the preparation of the code are as follows:
Private Sub Form_KeyPress (KeyAscii As Integer)
Me.Caption = Str (KeyAscii) 'the keyboard input of the characters
...
End Sub
9, I hope that the operation in the form of a central screen, how to achieve?
VB system object Screen Records show that the current mode of height and width, we can use this value to set the window position.
Sub CenterForm (frm As Form) 'definition process
Frm.Move (Screen.width - frm.width) \ 2, (Screen.Height - frm.Height) \ 2
End Sub
Private Sub Form_Load ()
CenterForm Me 'call process
End Sub
10, a lot of software has TextBox mouse in the text of a press box, select all the text function is how to achieve?
Private Sub Text1_GotFocus ()
Text1.SelStart = 0
Len Text1.SelLength = (Text1.Text) 'Procedure Call
End Sub |