首页 > 站长学院 > .Net专区 > .net中窗体的调整
 

.net中窗体的调整

日期:2005-06-28 00:00:00  来源:中国站长学院
请您记住思索网的网址: http://www.4so.net  [加入收藏夹]

    
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


 
 
热门信息
 
相关文章
 
    无相关信息