Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to darw arrow symbol usercontrol in C#

Posted on 2010-08-24
4
Medium Priority
?
1,251 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

927 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