Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 1st, 2004, 11:40 AM
Registered User
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drawing on top of components?

Hello all,

I'm implementing a drag-and-drop interface where colored panels in a row can be moved by dragging and dropping. I've started a solution that uses Graphics.FillRectangle and it works fine, with the exception that any other components placed on the form are on top of whatever is drawn. (Thinking about it, I'd expect this as the form's surface is what's drawn on.) How can I draw on top of them? I haven't found a way to draw directly on the screen - do I need to import some GDI calls? Do I copy the panel to an actual component and move that around?

Any help is greatly appreciated.



Jim Stanley
Media Services, Inc.
 
Old September 1st, 2004, 06:41 PM
Kep Kep is offline
Authorized User
 
Join Date: Aug 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could use panels (and set there colour property to the various shades) and allow the user to drag and drop these around.

I'm not sure I understand your problem fully though. Wouldn't you want to see the other components on the form? Otherwise, why would they be there? Or are you using the coloured panels to hide things?

Kep.
 
Old September 2nd, 2004, 06:06 PM
Registered User
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks - after discussion with The Boss, I think we'll go for another solution.



Jim Stanley
Media Services, Inc.
 
Old September 2nd, 2004, 09:01 PM
Authorized User
 
Join Date: Jul 2004
Posts: 69
Thanks: 0
Thanked 1 Time in 1 Post
Default

UserControls have a OnPaint Delegate that you can paint a control manually with. You also have to set the UserControl.UserDraw = true;

A Simple example can be found at

http://www.coderforrent.com/forums/v...e=&idthread=69

Hope this helps someone.



www.CoderForRent.com
Get A Computer Job!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing Shapes cbulutlar Javascript 2 March 6th, 2006 02:25 PM
drawing fergo Access VBA 0 June 6th, 2005 12:35 PM
drawing fergo BOOK: Access 2003 VBA Programmer's Reference 1 June 5th, 2005 09:32 AM
SELECT TOP n NOT SELECTING TOP n! ibi SQL Language 8 March 30th, 2005 08:08 PM
Drawing in C# stripytiger VS.NET 2002/2003 4 August 25th, 2004 10:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.