نمایش نتایج 1 تا 40 از 55

نام تاپیک: فرمی به شکل فایر فاکس

Threaded View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #8

    نقل قول: فرمی به شکل فایر فاکس

    سلام دوست عزیز


    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    TransparencyKey = SystemColors.Control;

    }
    private void DrawRoundedRectangle(Graphics gfx, Rectangle Bounds, int CornerRadius, Pen DrawPen, Color FillColor)
    {
    int strokeOffset = Convert.ToInt32(Math.Ceiling(DrawPen.Width));
    Bounds = Rectangle.Inflate(Bounds, -strokeOffset, -strokeOffset);
    DrawPen.EndCap = DrawPen.StartCap = LineCap.Round;
    GraphicsPath gfxPath = new GraphicsPath();
    gfxPath.AddArc(Bounds.X, Bounds.Y, CornerRadius, CornerRadius, 180, 90);
    gfxPath.AddArc(Bounds.X + Bounds.Width - CornerRadius, Bounds.Y, CornerRadius, CornerRadius, 270, 90);
    gfxPath.AddArc(Bounds.X + Bounds.Width - CornerRadius, Bounds.Y + Bounds.Height - CornerRadius, CornerRadius, CornerRadius, 0, 90);
    gfxPath.AddArc(Bounds.X, Bounds.Y + Bounds.Height - CornerRadius, CornerRadius, CornerRadius, 90, 90);
    Point[] points = { new Point(Bounds.X + 10, Bounds.Y), new Point(Bounds.X + 25, Bounds.Y - 15), new Point(Bounds.X + 40, Bounds.Y) };
    gfxPath.CloseAllFigures();
    gfx.FillPolygon(Brushes.SteelBlue, points);
    gfx.FillPath(new SolidBrush(FillColor), gfxPath);
    gfx.DrawPath(DrawPen, gfxPath);
    }
    protected override void OnPaint(PaintEventArgs e)
    {
    base.OnPaint(e);
    Rectangle Clinet = new Rectangle(ClientRectangle.X, ClientRectangle.Y + 15, ClientRectangle.Width, ClientRectangle.Height - 15);
    DrawRoundedRectangle(this.CreateGraphics(),Clinet, 20, new Pen(Color.SteelBlue, 4), Color.White);

    }
    }
    آخرین ویرایش به وسیله behzad1986 : دوشنبه 30 مرداد 1391 در 01:08 صبح

تاپیک های مشابه

  1. چگونه می توان فرمی با شکل مورد نظر خودمان ایجاد کنیم که فرم اصلی در زیر پیدا باشد؟
    نوشته شده توسط hassan_kahrizy در بخش برنامه نویسی با زبان C و ++C
    پاسخ: 2
    آخرین پست: جمعه 06 آبان 1384, 16:49 عصر

برچسب های این تاپیک

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •