Solved

how to darw arrow symbol usercontrol in C#

Posted on 2010-08-24
4
1,235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 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