Solved

how to darw arrow symbol usercontrol in C#

Posted on 2010-08-24
4
1,178 Views
Last Modified: 2012-05-10
how to darw the arrow symbol usercontrol in C#.only the arrow symbol.no need the line.
arrowsymbol.bmp
0
Comment
Question by:YetAnotherCoder
  • 2
4 Comments
 
LVL 12

Expert Comment

by:w00te
ID: 33512880
Well you could either literally create a canvas and use drawing commands (very overkill) or you could just do the normal thing and get JPEG or whatever of what you want and toss it in a PictureBox control.  The 2nd option is usually much better becuase you can get much better images than you could ever draw on canvas with the C# drawing tools.
-w00te
0
 

Author Comment

by:YetAnotherCoder
ID: 33513039
Hi W00te,

i want that arrow works in usercontrol. i design the  another  big screens. i want to use this  arrow in that screen.

i used line control  in visual powerpacks line. thatswhy i dont need line. only arrow usercontrol i need.
0
 
LVL 8

Expert Comment

by:mac-will
ID: 33515705
just put a label on the control and add the text ">"

Can you tell us what you are trying to do?
0
 
LVL 8

Accepted Solution

by:
mac-will earned 500 total points
ID: 33515803
Here is a user control that draws this arrow.
   public partial class ArrowControl : UserControl

    {

        public ArrowControl()

        {

            InitializeComponent();



            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            SetStyle(ControlStyles.UserPaint, true);

            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

        }



        protected override void OnPaint(PaintEventArgs e)

        {

                base.OnPaint(e);



                GraphicsPath path = new GraphicsPath();

                List<Point> pnts = new List<Point>();

                pnts.Add(new Point((int)(0), (int)(0)));

                pnts.Add(new Point((int)(this.Width), (int)(.50f * this.Height)));

                pnts.Add(new Point((int)(0), (int)(this.Height)));



                path.AddLines(pnts.ToArray());

                path.StartFigure();



                e.Graphics.DrawPath(Pens.Black, path);

        }

    }

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now