Windows Develop Bookmark and Share   
 index > Windows Forms Designer > What can cause SmartTags not to be displayed ?
 

What can cause SmartTags not to be displayed ?

Hello Everyone,

I'm quite new at control with rich design time support development, so...thank your for your patience .

Here is my trouble:
I wrote a control A that has SmartTags that work.
This control A can contain another controlof mine, lets call it B.
I want B to provide the same SmartTags as A. Thus I use the same descendant of DesignerActionList as I used for A. I extended this DesignerActionList descendant so that it is able to work with A and B.

If the SmartTags are perfectly working on A, they are not even shown (the top-right arrow is missing) on B. (B is always in A, i.e. A is the parent of B).

I debbuged the GetSortedActionItems calls from my DesignerActionList as well as ActionLists property from my designer: it is properly called (even several times) and produces the expected results.

What can cause my SmartTags not to be displayed in such a case?

I would greatly appreciate if you can share your ideas/solutions with me,

Many thanks in advance,

Neilos
Neilos1  Monday, February 11, 2008 1:12 PM

Hi Neilos,

Based on my understanding, you want to enable the SmartTag for the nested control in designer time, don’t you? If so, you need to enable the designer time feature for the nested control by custom a designer. Here is a sample for your information.

Code Snippet

[Designer(typeof(DesignertimeSupportforNestedControlDisigner))]

public partial class DesignertimeSupportforNestedControl : UserControl

{

public DesignertimeSupportforNestedControl()

{

InitializeComponent();

}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]

public ComboBox MyComboBox

{

get { return this.comboBox1; }

}

}

class DesignertimeSupportforNestedControlDisigner : System.Windows.Forms.Design.ControlDesigner

{

public override void Initialize(IComponent comp)

{

base.Initialize(comp);

DesignertimeSupportforNestedControl uc = (DesignertimeSupportforNestedControl)comp;

EnableDesignMode(uc.MyComboBox, "MyComboBox");

}

}

Let know if this helps, if not, could you please provide some detailed information?

Best regards.
Rong-Chun Zhang

Rong-Chun Zhang  Friday, February 15, 2008 6:50 AM

Hi Neilos,

Based on my understanding, you want to enable the SmartTag for the nested control in designer time, don’t you? If so, you need to enable the designer time feature for the nested control by custom a designer. Here is a sample for your information.

Code Snippet

[Designer(typeof(DesignertimeSupportforNestedControlDisigner))]

public partial class DesignertimeSupportforNestedControl : UserControl

{

public DesignertimeSupportforNestedControl()

{

InitializeComponent();

}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]

public ComboBox MyComboBox

{

get { return this.comboBox1; }

}

}

class DesignertimeSupportforNestedControlDisigner : System.Windows.Forms.Design.ControlDesigner

{

public override void Initialize(IComponent comp)

{

base.Initialize(comp);

DesignertimeSupportforNestedControl uc = (DesignertimeSupportforNestedControl)comp;

EnableDesignMode(uc.MyComboBox, "MyComboBox");

}

}

Let know if this helps, if not, could you please provide some detailed information?

Best regards.
Rong-Chun Zhang

Rong-Chun Zhang  Friday, February 15, 2008 6:50 AM
Hi Rong-Chun Zhang,

thank you very much for your answer. I apologize I have not answered earlier but I was quite busy with another problematic.
Humm your solution seems to work very well for the Verbs, but I still do not see my smart tags.

In fact I have two user controls derived from Panel. One is to be contained in the other (Dock is set to fill). Both have a designer that inherits a common one, thus shares the same verbs and actionslist (not the instances but the way their are constructed).

I can now use the verbs on my container as well as the contained panel. But the smart tags does not work on the contained panel.

Do you have any clue why ?
Neilos1  Tuesday, February 26, 2008 8:47 AM

You can use google to search for other answers

Custom Search

More Threads

• Host Designer Questions
• outlook forms, custom template -- doesnt allow us to use scroll button on mouse
• scroll bar is hidden in my user control
• My Question about toolbar in VS2005
• Drop down list in designer for string property
• Combobox event usercontrol
• VS.NET Toolbox
• Do we still need to implement designerhost with the arrival of designsurface
• Encrypting the content of a textbox
• Pasteboard