We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Different behaviour design-time vs run-time

andrewjb
andrewjb asked
on
Medium Priority
273 Views
Last Modified: 2010-04-16
Could someone point me in the right direction, perchance..?

How can I have a control that behaves slightly differently in design mode cf run-time mode.

I'd like to:

a) Render it slightly differently
b) Have some contained controls 'active' at design time.


For example, the Infragistics 'Grid' control has a button visible in design mode that's not there at runtime. I can click that button within the IDE to open up a setup form.. How's that functionality achieved?
Comment
Watch Question

Commented:
Use ISite.DesignMode property for this:

if ( Site.DesignMode )
{
    // Control site is is designe mode
}
else
{
    // run time
}

Notice that not all functions of control are called at design time. Functions which are called are paint handler and functions responsible for persistence.

Author

Commented:
I take it that lets me render differently..

But how do I make, for example, a button on a control 'active' at design time? If I simply shove a button on a usercontrol it doesn't respond, does it?

Commented:
You can only draw control at design time. It doesn't respond to mouse messages.

Author

Commented:
That can't be true - the Infragistics component set have buttons that are active at design time :-)

Commented:
I tested this one more time - it doesn't work by such way. I guess they have child control inside of Infragistics component  - in this case it can handle mouse messages.

Author

Commented:
I've now found out how to do it... You need to implement a ControlDesigner, which wraps around your actual control and interacts with the IDE at design time.

Commented:
Closed, 250 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.