Controler

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

I have a checkedListBox in the Form and have noticed that if I want to check
a checkbox for one row in the checkedListBox I have to do it in two steps.
First click on the selected row and then check the checkbox for the selected
row.

I just wonder if it's possible to do this in one step instead of two?

My second question is : Does it exist controller that is only available
during runtime ?
If yes can you just specify some of them ?

//Tony
 
Hi Tony,

The default implementation of CheckedListBox differentiates between
selecting an item and checking the item, which is why you first need to
select it and then check it. You can change this behaviour by setting the
CheckOnClick property to true. Selecting an item will then check it as well,
regardless of clicking on the checkbox or not.

If you want the CheckBox checked only when the CheckBox is clicked, and not
when the item is selected, use a ListView with checkboxes in Details view and
HeaderStyle.None. (Note you need at least one column to be able to see the
items)

As for controls only available during runtime. Not sure. Everything done
in design mode can also be done at runtime. Every control can potentially be
shows in the toolbar and dragged onto a control at design time, although you
don't need it in the toolbar to be able to use it. For instance, if you
create your own usercontrols. These may not always be visible in the toolbar.

To create a control at runtime:

// Anywhere in your code provided the code runs inside a Form or Control class
Controls.Add( new TextBox() );
 
Back
Top