In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you what VB.NET forms application skills, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Open Visual Studio 2008 on the File (File) menu, click New Project (New Project). In the template (Templates) pane of the New Project (New Project) dialog box, click Windows Application (Windows Application). Click OK (OK)
VB.NET forms application tip one, create floating forms.
After creating the new project, select the Form1 form and add Timer1 and Timer2 controls. Choose a good-looking background for the form, of course, you can also use the system default background.
Enter the code editor and enter the code:
Public Class Form1 Inherits System.Windows.Forms.Form Private Sub Form1_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadDim pos As Point = New Point (100,50) 'set the initial position of the form Me.DesktopLocation = posTimer1.Interval = 10' set the value of Timer Timer1.Enabled = TrueTimer2.Interval = 10Timer2.Enabled = False End Sub
Enter the Timer1_Tick event
Private Sub Timer1_Tick (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.TickDim pos As Point = New Point (Me.DesktopLocation.X + 2, Me.DesktopLocation.Y + 1) 'form the timer1 plus If pos.X of the upper left Abscissa of the form
< 600 Or pos.Y < 400 ThenMe.DesktopLocation = posElseTimer1.Enabled = FalseTimer2.Enabled = TrueEnd If End Sub 进入Timer2_Tick事件 Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.TickDim pos As Point = New Point(Me.DesktopLocation.X - 2, Me.DesktopLocation.Y - 1) '窗体的左上方横坐标随着timer2减一 If pos.X >100 Or pos.Y > 50 ThenMe.DesktopLocation = posElseTimer1.Enabled = TrueTimer2.Enabled = False End If End Sub
After the creation is complete, let's run the program to test it. The test is successful, and the program is constantly moving back and forth on the screen.
VB.NET forms Application Tip 2: create transparent forms.
After creating the new project, select the Form1 form and add Label1, TrackBar1, Timer1 controls. To highlight the effect, choose a good-looking background for the form.
The relevant property settings are as follows:
TrackBar1 Value attribute:
TickFrequency: attributes:
Maximum attribute: 100
ten
one hundred
Label1 Text property: select the transparency of the form:
Timer1 Interval attribute: 100
Enter the code editor and enter the code:
First of all, make a statement:
Public Class Form1 Inherits System.Windows.Forms.FormDim tps As IntegerDim bol As Boolean
Enter the TrackBar1_Scroll event
Private Sub TrackBar1_Scroll (ByVal sender As Object, ByVal e As System.EventArgs) Handles TrackBar1TrackBar1.ScrollMe.Opacity = TrackBar1.Value / 100Label1.Text = "form Transparency:" & CStr (Me.Opacity * 100) & "%" End Sub
Enter the Timer1_Tick event
Private Sub Timer1_Tick (ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.TickIf bol = False Thentps
= tps + 1Me.Opacity = tps / 100If Me.Opacity > = 1 ThenTimer1.Enabled = Falsebol = TrueEnd IfElsetps = tps-1Me.Opacity =
Tps / 100If Me.Opacity
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.