Selecting a region on a form

  • Thread starter Thread starter Dino M. Buljubasic
  • Start date Start date
D

Dino M. Buljubasic

I have a form that contains 24 user controls representing hours (something
like MS Outlook daily calendar). I would like to be able to
mouse-down-drag-mouse-up select a region of the form so that selected hours
(say from 8:00am till 1:00pm) appear highlighted or shaded (like in MS
Outlook expres).

Any help will be appreciated
 
OK, letrs break this problem down.

You need several things.

1.) The co-ordinates of each control.

2.) A being Dragged Property

3.) A Mouse Down event on the form

4.) A Mouse Up Event on the form

5.) To Draw / Erase and redraw a square with a dotted line using the start
and new x/y co-ordinates

6.) A method to check the TopLeft/Bottom right co-ordinates pairs come
inside the selection area of the forms graphics region

Thats it. !

I could do this for you, but I wont, I think there is sufficient information
here for you to go away and try this and then come back with more finite
questions.

"Endurance is good for the spirit !"

OHM
 
Here is a link to a simple demo of Drawing a Selection (Rubberband) box on a
Picturebox. This program also crops images.
But, the code within should give you the general idea on how to draw the
selection area on a form too, as a form also has a MouseDown, MouseMove, and
MouseUp events. Then you can figure out how to
get the area that is captured and highlight the objects you are wanting to
capture.
Scroll down the page to: Rubberband Selection Box for Cropping Images" Code
and all is in the zip file you download.

james
aka: Trucker

(watch for word wrap)
http://www.gotdotnet.com/community/usersamples/Default.aspx?LanguageDropDown
List=VB.NET&SortDirection=Desc&SortColumnName=CreationDate&Page=8&Size=25
 
The posted message asks for 'any' help, not for finished project, therefore
no need for you to work on it. The lead is welcome enough. :)

I appreciate your help,
Dino
 
thanks James,

Dino

--


-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com


james said:
Here is a link to a simple demo of Drawing a Selection (Rubberband) box on a
Picturebox. This program also crops images.
But, the code within should give you the general idea on how to draw the
selection area on a form too, as a form also has a MouseDown, MouseMove, and
MouseUp events. Then you can figure out how to
get the area that is captured and highlight the objects you are wanting to
capture.
Scroll down the page to: Rubberband Selection Box for Cropping Images" Code
and all is in the zip file you download.

james
aka: Trucker

(watch for word wrap)
http://www.gotdotnet.com/community/usersamples/Default.aspx?LanguageDropDown
List=VB.NET&SortDirection=Desc&SortColumnName=CreationDate&Page=8&Size=25
 
Back
Top