Make an immediate dynamic button with VB

zhaozj2021-02-17  49

Use the VB to make an instant dynamic button First, generate two sizes of buttons for both sizes to Command1 and Command2 on the main form, set their style attributes to 1-graphical, set the Picture property of Command1 to D: / VB / ICO / Mail01a.ico (the previous pattern, a closed envelope), set the Picture property of Command2 to D: /VB/ICO/mail101b.ico (a changed pattern, an open envelope). Second, add the following code in the Private Sub Form-Load () of the main form: Form1.Command1.top = form1.height-7000form1.command1.left = form1.width-1300form1.command2.top = form1.Height-7000form1 .Command2.Left = form1.width-1300 'makes these two buttons to be restored in the upper right corner of the form FORM1.COMMAND1.Visible = trueform1.command2.visible = false' hide the command2 button, display the command1 button again, in Command1 The following code is added: if form1.command1.visible = true1nform1.command1.visible = falseform1.command2.visible = trueend IF Finally, add the following code in the Form-Mousemove event: (if the button is placed in the chart box) On the Picture1-Mousemove event to join the code) if form1.command1.visible = false thenform1.command2.visible = falseform1.command1.visible = trueEnd IF

转载请注明原文地址:https://www.9cbs.com/read-29653.html

New Post(0)