473,395 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

drawing selection box

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
Nov 15 '05 #1
2 6429
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
"Kristof Nachtergaele" <ik**@nie.com> wrote in message
news:3f***********************@reader0.news.skynet .be...
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

Nov 15 '05 #2
here's an unabashed plug for BobPowell's Gdi+Faq and
tools:
http://www.bobpowell.net/faqmain.htm
http://www.bobpowell.net/rband.htm

HTH!

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

Hope this helps

-vJ
"Kristof Nachtergaele" <ik**@nie.com> wrote in message
news:3f***********************@reader0.news.skyne t.be...
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

.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tomi Holger Engdahl | last post by:
I am looking for a solution to add on-line drawing tool to a phpBB discussion board. The idea would be that the users can draw their own simple drawings with the tool and attach them easily as...
0
by: fragget | last post by:
Does anyone have experience drawing a selection box around runtime controls. I foundthe ControlPaint.DrawSelectionRectangle (or whatever it is, however it doesn't have the nubs for resizing the...
1
by: Rachel Suddeth | last post by:
I have an form where the whole display is a tab control (well, that plus a status bar.) I want to set the focus to the first TextBox on the first TabPage when it loads. I tried to put that into...
1
by: Brad Allison | last post by:
This is a newbie question. I have a combo box in where the end user will select an item (an obedience class - yes for dogs, not for developers) and then assign an obedience judge to that class. ...
5
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
4
by: RobinS | last post by:
I am drawing a rectangle on a picture that has already been drawn on the graphics area (a user control). It works something like this: //in the MouseDown event m_isDragging = true; m_oldX =...
4
by: Mtek | last post by:
Hi, We have a combo box on our page, which gets populated via a MySQL Query in PHP. What we want to do is to print the values on the page in a table that correspond the to selection from the...
2
by: ouzsharp | last post by:
The follwing class works well when used in a C# console application: namespace ScreenShotDemo { /// <summary> /// Provides functions to capture the entire screen, or a particular...
0
by: Tom Schoffelen | last post by:
Hi, I'm using VB Express 2010. I'm creating an application for digital smartboards to write on it and send the data directly to a web service. I'm using an Panel with inkOverlay (Microsoft.ink)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.