الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

اريد كود الطباعه ارجو المساعده

بدأه nouff في 8 يناير 2009 · 3 رد · 690 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بســم الله الـرحمــن الرحيــم

السلام عليكــم ورحمـة الله وبركاتــه

عملت برنامج فيه ازرار وتيكست بوكس واريد اطبع المعلومات التي تظهر بالتيكست بوكس

اتمنى ان تفيدوني بالكود

وجزااااكم الله خيرررررررررررررررررررررررررررررررررررررررررر

اختكم نوفاا

#2

أخـ(ـتـ)ـي الكريم(ـة) .

الرجاء التوضيح بشكل ادق, لا يمكننا تخيل الطريقة التي تريد طباعة النصوص فيها, كل مايمكنني إخبارك إياه هو ( استخدام الـ PrintDocument ) .

مثال بسيط :

 

Imports [color= #990000;]System[color= #339933;].Drawing[color= #339933;].Printing

[color= #000000; font-weight: bold;]Public [color= #000000; font-weight: bold;]Class Form1

    [color= #000000; font-weight: bold;]Private WithEvents DocToPrint [color= #b1b100;]As [color= #000000; font-weight: bold;]New PrintDocument

 

    [color= #000000; font-weight: bold;]Private Sub Button1_Click[color= #009900;](ByVal Sender [color= #b1b100;]As [color= #990000;]System[color= #339933;].Object[color= #339933;], [color= #990000;]_

    ByVal E [color= #b1b100;]As [color= #990000;]System[color= #339933;].EventArgs[color= #009900;]) Handles Button1[color= #339933;].Click

        DocToPrint[color= #339933;].[color= #990000;]Print[color= #009900;]([color= #009900;])

    [color= #990000;]End Sub

 

    [color= #000000; font-weight: bold;]Private Sub DocToPrint_PrintPage[color= #009900;](ByVal Sender [color= #b1b100;]As Object[color= #339933;], [color= #990000;]_

    ByVal E [color= #b1b100;]As [color= #990000;]System[color= #339933;].Drawing[color= #339933;].Printing[color= #339933;].PrintPageEventArgs[color= #009900;]) Handles DocToPrint[color= #339933;].PrintPage

        Dim SBrush [color= #b1b100;]As [color= #000000; font-weight: bold;]New SolidBrush[color= #009900;](Color[color= #339933;].Black[color= #009900;])

        [color= #b1b100;]For [color= #990000;]Each Con [color= #b1b100;]As Control In Me[color= #339933;].Controls

            [color= #b1b100;]If TypeOf Con Is TextBox Then

                SBrush[color= #339933;].Color [color= #339933;]= Con[color= #339933;].ForeColor

                E[color= #339933;].Graphics[color= #339933;].DrawString[color= #009900;](Con[color= #339933;].Text[color= #339933;], Con[color= #339933;].Font[color= #339933;], SBrush[color= #339933;], Con[color= #339933;].Location[color= #009900;])

            [color= #990000;]End [color= #b1b100;]If

        [color= #990000;]Next

        SBrush[color= #339933;].Dispose[color= #009900;]([color= #009900;])

    [color= #990000;]End Sub

 

[color= #990000;]End [color= #000000; font-weight: bold;]Class

هذا المثال, يطبع جميع النصوص من الـ TextBoxes الموجودة في الـ Form الرئيسية ( الحاوية لهذا الـ Code ), كل نص سيطبع حسب ( الخط, اللون, المكان ) .

تم تعديل هذه المشاركة بواسطة Bashar Rabat في 8 يناير 2009 في 01:13

The important thing is not so much

that every child should be taught,

as that every child should be given the wish to learn.

#3
Bashar Rabat كتب:
أخـ(ـتـ)ـي الكريم(ـة) .

الرجاء التوضيح بشكل ادق, لا يمكننا تخيل الطريقة التي تريد طباعة النصوص فيها, كل مايمكنني إخبارك إياه هو ( استخدام الـ PrintDocument ) .

مثال بسيط :

  1. Imports System.Drawing.Printing Public Class Form1 Private WithEvents DocToPrint As New Print
    Document Private Sub Button1_Click(ByVal Sender As System.Object, _ ByVal E As System.EventAr
    gs) Handles Button1.Click DocToPrint.Print() End Sub Private Sub DocToPrint_PrintPage(ByVal S
    ender As Object, _ ByVal E As System.Drawing.Printing.PrintPageEventArgs) Handles DocToPrint.Pr
    intPage Dim SBrush As New SolidBrush(Color.Black) For Each Con As Control In Me.Controls If Typ
    eOf Con Is TextBox Then SBrush.Color = Con.ForeColor E.Graphics.DrawString(Con.Text, Con.Font,
    SBrush, Con.Location) End If Next SBrush.Dispose() End Sub End Class
  2.  

هذا المثال, يطبع جميع النصوص من الـ TextBoxes الموجودة في الـ Form الرئيسية ( الحاوية لهذا الـ Code ), كل نص سيطبع حسب ( الخط, اللون, المكان ) .

السلام

اولاً شاكره لك كثير

ومعليش بوضح لك اكثر يمكن تقدر تفيدني

انا استخدم فيجوال بيسك 2003

وعملت برنامج يظهر معلومات الموظف في تيكست بوكس وابي اطبع المعلومات هذي

وضعت زر للطباعه وابي كود او طريقه تطبع لي المعلومات

#4

أختي الكريمة Nouff(a) .

الـ Code المدرج يمثل فكرة الطباعة, إذا أردت تحديد مكان كل TextBox عليك القيام بالتالي :

Dim SBrush As New SolidBrush( Color.Black )

SBrush.Color = TextBox1.ForeColor : E.Graphics.DrawString( TextBox1.Text, TextBox1.Font, SBrush, موقع الإحداثي ( س X ) على خط العرض, موقع الإحداثي ( ع Y ) على خط الطول )

تم تعديل هذه المشاركة بواسطة Bashar Rabat في 9 يناير 2009 في 18:28

The important thing is not so much

that every child should be taught,

as that every child should be given the wish to learn.

مواضيع مشابهة