Solved

how to darw arrow symbol usercontrol in C#

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Printing 1 51
Expression Evaluater 3 27
Calculate number of nights between two dates 5 28
What are the simplest ways to create a Merge Sort? 3 15
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 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