|
-
Nov 8th, 2008, 04:39 PM
#1
Thread Starter
Not NoteMe
[3.0/LINQ] Is control selected at design time
Hi all,
Is it possible to determine whether a control is selected at design-time, if so, how?
Cheers.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Nov 8th, 2008, 05:32 PM
#2
PowerPoster
Re: [3.0/LINQ] Is control selected at design time
how do you mean? Can you explain further?
-
Nov 8th, 2008, 07:06 PM
#3
Re: [3.0/LINQ] Is control selected at design time
I think I understand what you mean but for what purpose exactly?
-
Nov 9th, 2008, 11:50 AM
#4
Thread Starter
Not NoteMe
Re: [3.0/LINQ] Is control selected at design time
I have a user created control that has no border, but does have a backcolor.
If its parent container control's backcolor is the same then it is effectively invisible.
To get around this if the control is being rendered as design-time and the backcolors are the same then it draws a dotted border.
When the control is selected at design time the designer draws its own dotted border, so my manually drawn one isn't needed.
P.S. The reason having an effectively invisible control on a form is that at run-time the form doesn't exist and is used purely to lay out a GUI for custom rendering using Microsoft XNA.
Last edited by SLH; Nov 9th, 2008 at 11:54 AM.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Nov 9th, 2008, 07:41 PM
#5
Re: [3.0/LINQ] Is control selected at design time
I'm not sure whether this will be useful or not but your control inherits the protected DesignMode property from the Component class. In theory you could just wrap the code that draws your border in an 'if' block:
CSharp Code:
if (!this.DesignMode) { // Draw border. }
That said, I've got a feeling that DesignMode will only be 'true' if the control itself is being designed, as opposed to residing on a form that's being designed. Give it a try and see what happens.
-
Nov 10th, 2008, 08:35 AM
#6
Thread Starter
Not NoteMe
Re: [3.0/LINQ] Is control selected at design time
Thanks for the reply jmcilhinney, but that's not quite what i'm after.
I know i can draw the control differently depending on whether we're in design mode or not.
What i want to do is draw it different if we are in design mode AND this control is the control that's selected in the designer. It's the second bit i'm having trouble with.
If it can't be done then it can't be done, i just thought it might be a nice touch.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|