GIDForums  

Go Back   GIDForums > Computer Programming Forums > .NET Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Sep-2004, 08:29
Aileen Aileen is offline
New Member
 
Join Date: Sep 2004
Posts: 1
Aileen is on a distinguished road

windows forms: drawing rectangles, creating regions and invalidating


Hi

I'm writing a program using visual C++.NET that lets users create boxes, drag them around a link them. I'm new to the gui world and am having lots of syntax errors using .net. So far, i've created a picturebox and everytime the user choses to add a box, a rectangle is drawn. I track the rectangles movements using mouse events and invalidate to re-draw the screen.

The problem is when there are 2 or more boxes on the screen i only want to invalidate the "clean" region. So i thought id create a region comprising of the picturebox and exclude rectangles as they're created.. so when i cal invalidate only the clean area is re-drawn.

But i can't seem to create a region:
Region R = Region(pictureBox):
or even Region R = Region(a); ...where a is a rectangle.

I'd really really appreciate any assistance i can get.
Much thank
Aileen =O)
  #2  
Old 10-Sep-2004, 08:16
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 961
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Quote:
Originally Posted by Aileen
Hi

I'm writing a program using visual C++.NET that lets users create boxes, drag them around a link them. I'm new to the gui world and am having lots of syntax errors using .net. So far, i've created a picturebox and everytime the user choses to add a box, a rectangle is drawn. I track the rectangles movements using mouse events and invalidate to re-draw the screen.

The problem is when there are 2 or more boxes on the screen i only want to invalidate the "clean" region. So i thought id create a region comprising of the picturebox and exclude rectangles as they're created.. so when i cal invalidate only the clean area is re-drawn.

But i can't seem to create a region:
Region R = Region(pictureBox):
or even Region R = Region(a); ...where a is a rectangle.

I'd really really appreciate any assistance i can get.
Much thank
Aileen =O)


You need to create a new instance of the Region.

CPP / C++ / C Code:
Region R = new Region(a);

You can't do anything with the first version though, because pictureBox is just a control...or is it? Well, that's what the name suggests, anyway...

Regards,
Luci
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
Last edited by LuciWiz : 10-Sep-2004 at 09:31.
 
 

Recent GIDBlogWriting a book by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:46.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.