How to show arrow selection like in Coderush

I am programming winforms using C # and vb.net.

I love the arrows used in coderush.

for those who haven't seen the coderush arrows see this image.

http://www.aspnetpro.com/productreviews/2004/08/asp200408bn_p/asp200408bn_p_image002.jpg http://www.aspnetpro.com/productreviews/2004/08/asp200408bn_p/asp200408bn_p_image002.jpg

http://www.aspnetpro.com/productreviews/2004/08/asp200408bn_p/asp200408bn_p_image002.jpg

I want to have something like this in my program. the only difference is that I will be using it to highlight text boxes and buttons.

I need an arrow, the text on the arrow is not important.

So maybe I need to do a generic function like DrawHighlightArrow (ControlName)

and it will somehow manage to draw an arrow next to that control

Please suggest a good geeky way to solve this problem in C # or Vb.net.

Thank.
Anna

+1


source to share


3 answers


Override the OnPaint method on the form and use the DrawImage () method of the object from the PainteEventArgs.Graphics property to draw the arrow bitmap.



+1


source


You can create a custom shape with a transparent background, paint an arrow on it using GDI + (using the marxidad technique above, or simply dropping the PictureBox on it and handling the Paint event).

Then just create a new instance of the arrow shape above the top of the existing "parent" shape (you may need to set TopMost to true) and start the timer to disappear.



The only thing to be observed is ...

  • cleaning up properly if you close the "parent" form prematurely and ...
  • going through any click events to the "parent" form.
+1


source


There is a really nice library here called Locus Effects here . Go check it out, it does exactly what you want it to do.

+1


source







All Articles