Want to add custom control into dockingcommandbar


Author
Message
JSW W.
JSW W.
Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)
Group: Forum Members
Posts: 127, Visits: 1

There are two control by default available, combobox and button for dockingcommandbar.

Are there way to insert other controls? If possible how to referent to it.

Thanks,


Angel Chorbadzhiev
Angel Chorbadzhiev
Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)
Group: Forum Members
Posts: 139, Visits: 184

Hello JSW W.,

You can subclass the NControlHostCommand class and in the constructor should create the desired control and call SetControl(control) method.

Here is an example how can create such a command that hosts a text box control:

public class NTextBoxCommand : NControlHostCommand

{

    public NTextBoxCommand()

    {

        NTextBox tb = new NTextBox();

        tb.Size = new Size(PrefferedWidth, PrefferedHeight);

        SetControl(tb);

    }

}

Then you need to create an instance of this class and add it to the toolbars Commands collection.

Regards,

Angel.


JSW W.
JSW W.
Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)
Group: Forum Members
Posts: 127, Visits: 1
hello almost there
Can you give me the trick to change order of the buttons? commands.add() listed my control on the right most.
Thanks,
JSW W.
JSW W.
Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)
Group: Forum Members
Posts: 127, Visits: 1
i use insert and all is well. Cheers
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search