CheckedListBox disabled, how to scroll?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?VmljdG9y?=

    CheckedListBox disabled, how to scroll?

    Hi,

    A simple, but yet frustrating issue. I am using CheckedListBox control on a
    Windows Form in a C# application. When I disable CheckedListBox, the vertical
    toolbar is becoming disabled also. So the user has no way to scroll control
    up and down to see what items are checked and what are not.

    Is it a way to disable control (so the user wouldn’t be able change checked
    items), but leave the control scrollable?

    Can be done by overriding WndProc and canceling some messages there?

    Thanks,
    Victor
  • Paul E Collins

    #2
    Re: CheckedListBox disabled, how to scroll?

    "Victor" <Victor@discuss ions.microsoft. comwrote:
    Is it a way to disable [CheckedListBox] (so the user wouldn’t be able
    change checked items), but leave the control scrollable?
    You probably could use WndProc, but here's a quick hack that does it
    more simply:

    private void checkedListBox1 _ItemCheck(obje ct sender, ItemCheckEventA rgs
    e)
    {
    e.NewValue = e.CurrentValue;
    }

    Eq.


    Comment

    • =?Utf-8?B?VmljdG9y?=

      #3
      RE: CheckedListBox disabled, how to scroll?

      I found a solution. Overriding OnItemCheck works nicely.
      Thanks.

      bool disableCheckBox es = true;

      protected override void OnItemCheck(Ite mCheckEventArgs ice)
      {
      if (disableCheckBo xes)
      ice.NewValue = ice.CurrentValu e;

      base.OnItemChec k(ice);
      }

      "Victor" wrote:
      Hi,
      >
      A simple, but yet frustrating issue. I am using CheckedListBox control on a
      Windows Form in a C# application. When I disable CheckedListBox, the vertical
      toolbar is becoming disabled also. So the user has no way to scroll control
      up and down to see what items are checked and what are not.
      >
      Is it a way to disable control (so the user wouldn’t be able change checked
      items), but leave the control scrollable?
      >
      Can be done by overriding WndProc and canceling some messages there?
      >
      Thanks,
      Victor

      Comment

      Working...