惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - 岳洋

关键词:vb.net 扑克 cards.dll 网上较好的提取链接的正则表达式 下载网页源代码的程序 一个读取网页源代码的小程序 file manager 0.1 circleliner阅读笔记 用于学习鼠标作图的网页。 写文件时换行的问题[转载] by 東風耐候 - 岳洋 用旧方法文件读写 - 岳洋 - 博客园 Birthday Reminder Framework 1.1版本 Birthday Reminder (R Edition) ver1.0 build 050813正式发布! 050627ReciteDemo0.2 050626诗歌背诵程序demo 050615 B-A-M v1.0源代码 050615 Bact.-Anti-Med.ver1.0正式发布! 新建一个按钮至少需要做的事情…… 我决定不再和窗体设计器争生意了! 050614Bact.-Anti-Med.v0.3最新更新 按钮的突然消失!(小记一次编程失误)
panel的使用
岳洋 · 2005-12-18 · via 博客园 - 岳洋

Imports System
Imports System.Drawing
Imports System.Windows.Forms

Namespace MouseEvent
    
' Summary description for Form1.
    Public NotInheritable Class Form1
        
Inherits System.Windows.Forms.Form
        
Friend WithEvents panel1 As System.Windows.Forms.Panel
        
Private mousePath As System.Drawing.Drawing2D.GraphicsPath
        
Public Shared Sub Main()
            System.Windows.Forms.Application.Run(
New Form1())
        
End Sub
 'Main

        
Public Sub New()

            mousePath 
= New System.Drawing.Drawing2D.GraphicsPath()

            
Me.panel1 = New System.Windows.Forms.Panel()
            
' Mouse Panel
            Me.panel1.Anchor = System.Windows.Forms.AnchorStyles.Top Or _
                                    System.Windows.Forms.AnchorStyles.Left 
Or _
                                    System.Windows.Forms.AnchorStyles.Right
            
Me.panel1.BackColor = System.Drawing.SystemColors.ControlDark
            
Me.panel1.Location = New System.Drawing.Point(16160)
            
Me.panel1.Size = New System.Drawing.Size(664320)

            
            
End Sub
 'New

        
Private Sub panel1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles panel1.MouseDown
            
' Update the mouse path with the mouse information
            Dim mouseDownLocation As New Point(e.X, e.Y)
            
            
Dim eventString As String = Nothing
            
Select Case e.Button
                
Case MouseButtons.Left
                    eventString 
= "L"
                
Case MouseButtons.Right
                    eventString 
= "R"
                
Case MouseButtons.Middle
                    eventString 
= "M"
                
Case MouseButtons.XButton1
                    eventString 
= "X1"
                
Case MouseButtons.XButton2
                    eventString 
= "X2"
                
Case MouseButtons.None:
                     eventString 
= Nothing              
            
End Select
            
            
If Not (eventString Is NothingThen
                mousePath.AddString(eventString, FontFamily.GenericSerif, 
CInt(FontStyle.Bold), fontSize, mouseDownLocation, StringFormat.GenericDefault)
            
Else
                mousePath.AddLine(mouseDownLocation, mouseDownLocation)
            
End If

            panel1.Focus()
            panel1.Invalidate()
        
End Sub
 
        
        
Private Sub panel1_MouseEnter(sender As Object, e As System.EventArgs) Handles panel1.MouseEnter
            
' Update the mouse event label to indicate the MouseEnter event occurred.
            label1.Text = sender.GetType().ToString() + ": MouseEnter"
        
End Sub

        
        
Private Sub panel1_MouseHover(sender As Object, e As System.EventArgs) Handles panel1.MouseHover
            
' Update the mouse event label to indicate the MouseHover event occurred.
            label1.Text = sender.GetType().ToString() + ": MouseHover"
        
End Sub

        
        
Private Sub panel1_MouseLeave(sender As Object, e As System.EventArgs) Handles panel1.MouseLeave
            
' Update the mouse event label to indicate the MouseLeave event occurred.
            label1.Text = sender.GetType().ToString() + ": MouseLeave"
        
End Sub

        
        
Private Sub panel1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles panel1.MouseMove
            
' Update the mouse path that is drawn onto the Panel.
            Dim mouseX As Integer = e.X
            
Dim mouseY As Integer = e.Y
            
            mousePath.AddLine(mouseX, mouseY, mouseX, mouseY)
        
End Sub

        
Private Sub panel1_MouseWheel(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles panel1.MouseWheel
            
' Update the drawing based upon the mouse wheel scrolling.
            Dim numberOfTextLinesToMove As Integer = e.Delta * SystemInformation.MouseWheelScrollLines / 120 ' WHEEL_DATA
            Dim numberOfPixelsToMove As Integer = numberOfTextLinesToMove * fontSize
            
            
If numberOfPixelsToMove <> 0 Then
                
Dim translateMatrix As New System.Drawing.Drawing2D.Matrix()
                translateMatrix.Translate(
0, numberOfPixelsToMove)
                mousePath.Transform(translateMatrix)
            
End If

            panel1.Invalidate()
        
End Sub

        
Private Sub panel1_MouseUp(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles panel1.MouseUp
            
Dim mouseUpLocation = New System.Drawing.Point(e.X, e.Y)
            
            
' Show the number of clicks in the path graphic.
            Dim numberOfClicks As Integer = e.Clicks
            mousePath.AddString(
"     " + numberOfClicks.ToString(), _
                                FontFamily.GenericSerif, 
CInt(FontStyle.Bold), _
                                fontSize, mouseUpLocation, StringFormat.GenericDefault)

            panel1.Invalidate()
        
End Sub

        
        
Private Sub panel1_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles panel1.Paint
            
' Perform the painting of the Panel.
            e.Graphics.DrawPath(System.Drawing.Pens.DarkRed, mousePath)
        
End Sub

        
        
Private Sub clearButton_Click(sender As Object, e As System.EventArgs) Handles clearButton.Click
            
' Clear the Panel display.
            mousePath.Dispose()
            mousePath 
= New System.Drawing.Drawing2D.GraphicsPath()
            panel1.Invalidate()
        
End Sub

        
    
End Class
 'Form1
End Namespace