Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Drawing / November 2004

Tip: Looking for answers? Try searching our database.

ControlPaint class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patrick - 24 Nov 2004 03:41 GMT
Hi Ng,

I'm trying to imitate the Windows Form Designer in VS. Is there a method in
the ControlPaint class to show this selection rectangle when you click on a
control to select it?Or can it be implemented on another way.

Thanks in advance and best regards
Patrick
Bob Powell [MVP] - 24 Nov 2004 08:59 GMT
Are you really trying to create a designer host or just move controls around
at runtime?

There is a project called SharpDevelop that explores this extensively and
it's open-source. http://www.icsharpcode.net/OpenSource/SD/

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Hi Ng,
>
[quoted text clipped - 4 lines]
> Thanks in advance and best regards
> Patrick
Patrick - 25 Nov 2004 02:29 GMT
Hi Bob,

yeah, actually I'm just trying to move around controls at runtime. Do you
have any further good hints. I will browse your mentioned project.

Thanks and regards

> Are you really trying to create a designer host or just move controls around
> at runtime?
[quoted text clipped - 12 lines]
> > Thanks in advance and best regards
> > Patrick
Bob Powell [MVP] - 25 Nov 2004 10:13 GMT
Moving controls at runtime doesn't require IDesignerHost and all that jazz.
You can just move them around.

There isn't a method to do it directly in ControlPaint but you can use the
DrawReversible<xxx> routines to draw around where the control is on screen
to create the effect. You'll have to handle the mouse moves and such
yourself.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Hi Bob,
>
[quoted text clipped - 19 lines]
> > > Thanks in advance and best regards
> > > Patrick
Patrick - 25 Nov 2004 13:01 GMT
Hi,

ok, I'm using the mouse move etc, I can move my controls, everything works
fine. I only have two more problems:

1) how can I select a control and visualize this with this surrounding frame?
2) how can I resize my control with this surrounding frame?

it would be very nice if you have further tips. which methods of the
ControlPaint class (or another one) do I have to use for this purpose and
where do I call them.

Do you also know how to use the property grid? I've seen sth on your website.

Thank you very much in advance.

Best regards,
Patrick

"Bob Powell [MVP]" schrieb:

> Moving controls at runtime doesn't require IDesignerHost and all that jazz.
> You can just move them around.
[quoted text clipped - 31 lines]
> > > > Thanks in advance and best regards
> > > > Patrick
Bob Powell [MVP] - 25 Nov 2004 13:46 GMT
Moving and sizing is pretty laborious. You need to create grab-handles that
represent the corners and the sides, track the mouse moves and button clicks
in them, redraw the rectangle and resize the control. All pretty standard
stuff but a pain to do.

Yes, I know about PropertyGrid...

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Hi,
>
[quoted text clipped - 52 lines]
> > > > > Thanks in advance and best regards
> > > > > Patrick
Bob Powell [MVP] - 25 Nov 2004 13:47 GMT
Contact me by private mail. I may be able to help you.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Moving controls at runtime doesn't require IDesignerHost and all that jazz.
> You can just move them around.
[quoted text clipped - 31 lines]
> > > > Thanks in advance and best regards
> > > > Patrick

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.