盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

.net中窗体的调整

时间:2024/12/20作者:未知来源:盾怪网教程人气:

[摘要]Private r As RectangleF Private m_image As Image = Image.FromFile("g:\picture.bmp") ...
Private r As RectangleF

 

    Private m_image As Image = Image.FromFile("g:\picture.bmp")

 

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Try

            r = New RectangleF(0, 0, Me.ClientSize.Width, Me.ClientSize.Height)

        Catch ex As Exception

            MessageBox.Show(ex.Message)

        End Try

    End Sub

 

    Private Sub mydrawimage()

        Try

            Dim g As Graphics = Me.CreateGraphics

            g.DrawImage(m_image, r)

            g.Dispose()

        Catch ex As Exception

 

        End Try

    End Sub

    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

 

        mydrawimage()

 

    End Sub

 

    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize

 

        r = New RectangleF(0, 0, Me.ClientSize.Width, Me.ClientSize.Height)

 

        mydrawimage()

    End Sub




关键词:.net中窗体的调整




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版