drawing selection box

  • Thread starter Thread starter Kristof Nachtergaele
  • Start date Start date
K

Kristof Nachtergaele

Hi,

i'm working on something in which i'm using a panel to arrange icons/text
on. Now I want to add the possibility to click - drag - release, and while
dragging display a retangle indicating the selected area. Anyone able to
give me a hint on how to handle this?

Thanks,
Kristof
 
Surprisingly, .Net GDI doesn't provide an XOR draw operation. Therefore it
becomes non-trivial to draw a rubber-band line or a drag rectangle, like the
one you are describing. One way I got this solved is using Native GDI
calls, like Rectangle(...) and passing in the Graphics object's DC handle to
it. You can do an XOR draw and erase it the same way.

Hope this helps

-vJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top