?
Solved

Different behaviour design-time vs run-time

Posted on 2006-03-24
8
Medium Priority
?
254 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?
0
Comment
Question by:andrewjb
  • 3
  • 3
7 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 16283224
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.
0
 
LVL 12

Author Comment

by:andrewjb
ID: 16290827
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?
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 16292413
You can only draw control at design time. It doesn't respond to mouse messages.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 12

Author Comment

by:andrewjb
ID: 16293974
That can't be true - the Infragistics component set have buttons that are active at design time :-)
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 16294017
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.
0
 
LVL 12

Author Comment

by:andrewjb
ID: 16341095
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.

0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16371040
Closed, 250 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question