Solved

how to darw arrow symbol usercontrol in C#

Posted on 2010-08-24
4
1,228 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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