F
Fred Flintstone
I'm creating a multi-column dropdown since there isn't one. My idea
is to override an Infragistics Combo and add the dropdown as a grid
object. So I create a basic override of the control. The first thing
I want the control to do is kill the default button and add a new one.
So in the initialization (New) area of the control I add the code to
do that:
Me.DropDownButtonDisplayStyle =
Infragistics.Win.ButtonDisplayStyle.Never
Dim Button As New
Infragistics.Win.UltraWinEditors.EditorButton
Button.Key = "Drop"
Button.Visible = True
Button.Enabled = True
Button.Text = "..."
Me.ButtonsRight.Add(Button)
Fairly simple. I build that and load up a new project. I add the new
control in design view and run. I get an error saying "Key already
exists" (each button requires a unique key).
When I look at the "Form Designer Generated Code", it contains this:
EditorButton1.Key = "Drop"
EditorButton1.Text = "..."
Me.DropCombo2.ButtonsRight.Add(EditorButton1)
Why is this in my sample application? I added it to the new control's
initialization but it's added to the sample app code when the control
is dropped on the form. Why is the sample application trying to add
the button again? I would have thought the button would be created
ONCE when the control is created (which it is), not again when the
program is run. How do I stop it from adding this control code to the
sample app?
Thanks!
is to override an Infragistics Combo and add the dropdown as a grid
object. So I create a basic override of the control. The first thing
I want the control to do is kill the default button and add a new one.
So in the initialization (New) area of the control I add the code to
do that:
Me.DropDownButtonDisplayStyle =
Infragistics.Win.ButtonDisplayStyle.Never
Dim Button As New
Infragistics.Win.UltraWinEditors.EditorButton
Button.Key = "Drop"
Button.Visible = True
Button.Enabled = True
Button.Text = "..."
Me.ButtonsRight.Add(Button)
Fairly simple. I build that and load up a new project. I add the new
control in design view and run. I get an error saying "Key already
exists" (each button requires a unique key).
When I look at the "Form Designer Generated Code", it contains this:
EditorButton1.Key = "Drop"
EditorButton1.Text = "..."
Me.DropCombo2.ButtonsRight.Add(EditorButton1)
Why is this in my sample application? I added it to the new control's
initialization but it's added to the sample app code when the control
is dropped on the form. Why is the sample application trying to add
the button again? I would have thought the button would be created
ONCE when the control is created (which it is), not again when the
program is run. How do I stop it from adding this control code to the
sample app?
Thanks!