Click here to Skip to main content
15,911,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Move the unmovable Pin
jas0n231-Nov-08 12:15
jas0n231-Nov-08 12:15 
GeneralRe: Move the unmovable Pin
ltheonel6-Nov-08 12:45
ltheonel6-Nov-08 12:45 
GeneralRe: Move the unmovable Pin
jas0n236-Nov-08 16:17
jas0n236-Nov-08 16:17 
GeneralRe: Move the unmovable Pin
ltheonel9-Nov-08 8:33
ltheonel9-Nov-08 8:33 
QuestionMapping XML to "anonymous" class Pin
ezazazel29-Oct-08 12:16
ezazazel29-Oct-08 12:16 
AnswerRe: Mapping XML to "anonymous" class Pin
N a v a n e e t h29-Oct-08 18:32
N a v a n e e t h29-Oct-08 18:32 
GeneralRe: Mapping XML to "anonymous" class Pin
ezazazel29-Oct-08 19:48
ezazazel29-Oct-08 19:48 
QuestionCreating a upgrade .msi file Pin
Brad Wick29-Oct-08 9:07
Brad Wick29-Oct-08 9:07 
QuestionCheck if a file was created in PP 2003 Pin
ophirmi29-Oct-08 8:28
ophirmi29-Oct-08 8:28 
AnswerRe: Check if a file was created in PP 2003 Pin
Giorgi Dalakishvili29-Oct-08 8:43
mentorGiorgi Dalakishvili29-Oct-08 8:43 
GeneralRe: Check if a file was created in PP 2003 Pin
ophirmi30-Oct-08 0:37
ophirmi30-Oct-08 0:37 
GeneralRe: Check if a file was created in PP 2003 Pin
Giorgi Dalakishvili30-Oct-08 1:08
mentorGiorgi Dalakishvili30-Oct-08 1:08 
GeneralRe: Check if a file was created in PP 2003 Pin
ophirmi30-Oct-08 2:46
ophirmi30-Oct-08 2:46 
GeneralRe: Check if a file was created in PP 2003 Pin
Giorgi Dalakishvili30-Oct-08 2:59
mentorGiorgi Dalakishvili30-Oct-08 2:59 
QuestionTab Pin
boiDev29-Oct-08 5:43
boiDev29-Oct-08 5:43 
AnswerRe: Tab Pin
Thomas Stockwell29-Oct-08 6:17
professionalThomas Stockwell29-Oct-08 6:17 
RantDouble Post Pin
Thomas Stockwell29-Oct-08 6:25
professionalThomas Stockwell29-Oct-08 6:25 
AnswerCP: Mark user as ABUSE Pin
leckey29-Oct-08 9:52
leckey29-Oct-08 9:52 
GeneralRe: CP: Mark user as ABUSE Pin
Paul Conrad29-Oct-08 11:05
professionalPaul Conrad29-Oct-08 11:05 
GeneralRe: CP: Mark user as ABUSE Pin
leckey29-Oct-08 13:35
leckey29-Oct-08 13:35 
AnswerRe: Tab Pin
asugix29-Oct-08 20:55
asugix29-Oct-08 20:55 
QuestionAdding controls at design time via DesignerActions [modified] Pin
Chris Copeland29-Oct-08 5:11
mveChris Copeland29-Oct-08 5:11 
Hi!

I'm part-way through making a control that utilises tab to switch between different panels. I have the code working that when the user clicks on a tab at design-time, it switches to the corresponding panel through the override WndProc in the ControlDesigner class.

I have another option though, using the DesignerActionList and DesignerActionListCollection, where I have an "Add tab" option in the Smart-tag.

In design time, it does actually add the tab. But, each tab is linked directly to a custom panel I made that should get added to the form too.
So when I click "Add tab", it invalidates my control so it writes the tab text on the top, but when I run the application it is promptly removed.
I clicked on my custom panel collection to see whether the tab is added to a collection inside the control when "Add tab" is clicked, and it is. But the problem is, it's simply not adding the control to the form's designer code.

public void AddTab()
{
    StylusOption STOpt = new StylusOption();
    int i = this.dtc.OptionTabs.Count;

    while(this.dtc.ParentForm.Controls["StyleOption" + i] != null)
        i++;

    STOpt.Name = "StyleOption" + i;

    this.dtc.ParentForm.Controls.Add(STOpt);
    this.dtc.ParentForm.CreateControl();
    this.dtc.OptionTabs.Add((StylusOption)this.dtc.ParentForm.Controls[this.dtc.ParentForm.Controls.Count - 1]);
    this.dtc.Invalidate();

    this.UIScu.HideUI(this.dtc);
}


That's the current code I have. StylusOption is the name of the control i'm trying to add, StylusBar is the control i'm adding it to, and this.dtc is the StylusBar i've set the handler to work with.

In the code, i've attempt to add the control via this.dtc.ParentForm.Controls.Add(STOpt); but even that doesn't work. I can't figure out how to add the StylusOption to the actual form to remember. If anyone can help, i'd appreciate it a lot.

An example of how i'd like it to work is like the TabControl, where if you click Add Tab, it creates a new TabPage in your form so you can edit any details there.

Thanks

modified on Wednesday, October 29, 2008 11:33 AM

AnswerRe: Adding controls at design time via DesignerActions Pin
Thomas Stockwell29-Oct-08 6:21
professionalThomas Stockwell29-Oct-08 6:21 
GeneralRe: Adding controls at design time via DesignerActions Pin
Chris Copeland29-Oct-08 10:42
mveChris Copeland29-Oct-08 10:42 
QuestionListView Column Sorting Pin
vishnukamath29-Oct-08 4:30
vishnukamath29-Oct-08 4:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.