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

بطاقة

بدأه alhathiq في 14 أبريل 2014 · 0 رد · 327 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1

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

قمت بانشاء برنامج يقوم باضافة بيانات الطلاب وانا الان اريد ان اقوم باصدار بطاقة مدرسية لكل طالب اريد  طريقة لعمل بطاقة لكل طالب

لدي طريقة  لكن اريد ان اضيف تحسينات على البطاقة ...ارجو المساعدة في اقرب وقت ولكم جزيل الشكر والتقدير..

هذا كود للطريقة  المستخدمة الان :

private void PrintInfo(object sender, Drawing.Printing.PrintPageEventArgs e)
{
    Pen MyPen = new Pen(Color.Black, 3);
    e.Graphics.DrawRectangle(MyPen, e.MarginBounds.X, e.MarginBounds.Y, 400, 200);
    Font MyFont = new Font("Arial", 12, FontStyle.Bold);
    string S = "جامعة حضرموت للعلوم والتنلوجيا";
    SizeF SSize = e.Graphics.MeasureString(S, MyFont);
    e.Graphics.DrawString(S, MyFont, Brushes.Black, e.MarginBounds.X + Convert.ToInt32(0.5 * (500 - SSize.Width)), e.MarginBounds.Y + 20);
    string Ss = "بطاقة جامعية";
    SizeF SSsize = e.Graphics.MeasureString(Ss, MyFont);
    e.Graphics.DrawString(Ss, MyFont, Brushes.Black, e.MarginBounds.X + Convert.ToInt32(0.5 * (500 - SSsize.Width)), e.MarginBounds.Y + 70);
    e.Graphics.DrawImage(PictureBox1.Image, e.MarginBounds.X + 10, e.MarginBounds.Y + 30, 120, 100);
    e.HasMorePages = false;
    MyFont = new Font("Arial", 14);
    int Y = e.MarginBounds.Y + 100;
    S = txtFirstName.Text + ":الاسم ";
    SSize = e.Graphics.MeasureString(S, MyFont);
    e.Graphics.DrawString(S, MyFont, Brushes.Black, e.MarginBounds.X + Convert.ToInt32(0.5 * (700 - SSize.Width)), Y);
    Y += Convert.ToInt32(MyFont.GetHeight(e.Graphics));
    S = txtLastName.Text + ":رقم القيد";
    SSize = e.Graphics.MeasureString(S, MyFont);
    e.Graphics.DrawString(S, MyFont, Brushes.Black, e.MarginBounds.X + Convert.ToInt32(0.5 * (700 - SSize.Width)), Y);
    Y += Convert.ToInt32(MyFont.GetHeight(e.Graphics));
    S = txtGrade.Text + ":التخصص ";
    SSize = e.Graphics.MeasureString(S, MyFont);
    e.Graphics.DrawString(S, MyFont, Brushes.Black, e.MarginBounds.X + Convert.ToInt32(0.5 * (700 - SSize.Width)), Y);
    S = DateTimePicker1.Text;
    SSize = e.Graphics.MeasureString(S, MyFont);
    e.Graphics.DrawString(S, MyFont, Brushes.Black, e.MarginBounds.X + Convert.ToInt32(0.5 * (700 - SSize.Width)), Y);
}

 

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