تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
صنع رأس للصفحة (هيدر)
#14
إستبدلي الأوامر الموجودة في مثالي بالأوامر التالية :
كود :
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        RichTextBox1.BorderStyle = BorderStyle.None
        RichTextBox2.BorderStyle = BorderStyle.None
        RichTextBox3.BorderStyle = BorderStyle.None
        RichTextBox1.ScrollBars = RichTextBoxScrollBars.None
        RichTextBox2.ScrollBars = RichTextBoxScrollBars.None
        RichTextBox3.ScrollBars = RichTextBoxScrollBars.None
        PictureBox1.BorderStyle = BorderStyle.None
        Dim Img As New Bitmap(Panel1.Width, Panel1.Height)
        Dim G As Graphics = Graphics.FromImage(Img)
        Dim Save As New SaveFileDialog
        Save.Filter = "PNG Image|*.png"
        Panel1.DrawToBitmap(Img, New Rectangle(0, 0, Panel1.Width, Panel1.Height))
        G.DrawImage(RtbToBitmap(RichTextBox1), RichTextBox1.Bounds)
        G.DrawImage(RtbToBitmap(RichTextBox2), RichTextBox2.Bounds)
        G.DrawImage(RtbToBitmap(RichTextBox3), RichTextBox3.Bounds)
        If Save.ShowDialog = Windows.Forms.DialogResult.OK Then
            Img.Save(Save.FileName, Imaging.ImageFormat.Png)
        End If
        RichTextBox1.ScrollBars = RichTextBoxScrollBars.Both
        RichTextBox2.ScrollBars = RichTextBoxScrollBars.Both
        RichTextBox3.ScrollBars = RichTextBoxScrollBars.Both
        RichTextBox1.BorderStyle = BorderStyle.FixedSingle
        RichTextBox2.BorderStyle = BorderStyle.FixedSingle
        RichTextBox3.BorderStyle = BorderStyle.FixedSingle
        PictureBox1.BorderStyle = BorderStyle.FixedSingle
    End Sub

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
        Dim Open As New OpenFileDialog
        Open.Filter = "Image Files|*.png;*.bmp;*.jpg;*.gif"
        If Open.ShowDialog = Windows.Forms.DialogResult.OK Then
            PictureBox1.Image = Image.FromFile(Open.FileName)
        End If
    End Sub

    Public Function RtbToBitmap(ByVal rtb As RichTextBox) As Bitmap
        rtb.Update()
        Dim bmp As New Bitmap(rtb.Width, rtb.Height)
        Using gr As Graphics = Graphics.FromImage(bmp)
            gr.CopyFromScreen(rtb.PointToScreen(Point.Empty), Point.Empty, rtb.Size)
        End Using
        Return bmp
    End Function
End Class
[SIZE=6]لا إله إلا أنت سبحانك إني كنت من [/SIZE][SIZE=6]الظالمين[/SIZE][SIZE=6]
[/SIZE]
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
صنع رأس للصفحة (هيدر) - بواسطة Sajad - 04-12-12, 06:38 PM
صنع رأس للصفحة (هيدر) - بواسطة Osama_Ghareeb - 04-12-12, 09:56 PM
صنع رأس للصفحة (هيدر) - بواسطة Sajad - 04-12-12, 10:01 PM
صنع رأس للصفحة (هيدر) - بواسطة Osama_Ghareeb - 05-12-12, 04:30 PM
صنع رأس للصفحة (هيدر) - بواسطة Osama_Ghareeb - 05-12-12, 06:36 PM
صنع رأس للصفحة (هيدر) - بواسطة Osama_Ghareeb - 06-12-12, 12:19 AM
صنع رأس للصفحة (هيدر) - بواسطة midosoft - 05-04-13, 04:56 PM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [سؤال] كيف نطبق عملية حفظ باسم للصفحة سعود 8 4,255 27-10-13, 02:52 PM
آخر رد: سعود

التنقل السريع :


يقوم بقرائة الموضوع: