Click here to Skip to main content
15,884,237 members
Home / Discussions / C#
   

C#

 
GeneralRe: Change Color of CheckedListBox's Item Pin
Heath Stewart27-Jan-04 11:36
protectorHeath Stewart27-Jan-04 11:36 
GeneralRe: Change Color of CheckedListBox's Item Pin
hxxbin28-Jan-04 4:46
hxxbin28-Jan-04 4:46 
GeneralRemove/hide scrollbar in listbox Pin
Fleischen27-Jan-04 9:18
Fleischen27-Jan-04 9:18 
GeneralRe: Remove/hide scrollbar in listbox Pin
Mazdak27-Jan-04 9:22
Mazdak27-Jan-04 9:22 
GeneralRe: Remove/hide scrollbar in listbox Pin
Fleischen27-Jan-04 9:39
Fleischen27-Jan-04 9:39 
GeneralRe: Remove/hide scrollbar in listbox Pin
Heath Stewart27-Jan-04 11:30
protectorHeath Stewart27-Jan-04 11:30 
GeneralRe: Remove/hide scrollbar in listbox Pin
Fleischen27-Jan-04 21:15
Fleischen27-Jan-04 21:15 
GeneralRe: Remove/hide scrollbar in listbox Pin
Heath Stewart28-Jan-04 5:21
protectorHeath Stewart28-Jan-04 5:21 
Sorry, I missed that for some reason.

To make a ListBox with no vertical scroll bar (there is a ListBox.HorizontalScrollbar that you can set to false), extend ListBox with your own class and override the CreateParams like so:
public class MyListBox : ListBox
{
  private const int WS_VSCROLL = 0x00200000;
  protected override System.Windows.Forms.CreateParams CreateParams
  {
    get
    {
      System.Windows.Forms.CreateParams parms = base.CreateParams;
      parms.Style &= ~WS_VSCROLL;
      return parms;
    }
  }
}
That will get rid of the vertical scroll bar. If you want, you could add a VerticalScrollbar that controls whether the WS_VSCROLL is set or unset and then call RecreateHandle after setting it:
public class MyListBox : ListBox
{
  private const int WS_VSCROLL = 0x00200000;
  protected override System.Windows.Forms.CreateParams CreateParams
  {
    get
    {
      System.Windows.Forms.CreateParams parms = base.CreateParams;
      if (!this.verticalScrollbar)
        parms.Style &= ~WS_VSCROLL;
      return parms;
    }
  }
  private bool verticalScrollbar;
  public virtual bool VerticalScrollbar
  {
    get { return this.verticalScrollbar; }
    set
    {
      if (this.verticalScrollbar != value)
      {
        this.verticalScrollbar = value;
        this.RecreateHandle();
      }
    }
  }
}


 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralC# Web Service with Oracle Pin
Chris Meech27-Jan-04 9:08
Chris Meech27-Jan-04 9:08 
GeneralRe: C# Web Service with Oracle Pin
Mazdak27-Jan-04 9:18
Mazdak27-Jan-04 9:18 
GeneralRe: C# Web Service with Oracle Pin
Chris Meech27-Jan-04 9:31
Chris Meech27-Jan-04 9:31 
GeneralRe: C# Web Service with Oracle Pin
Mazdak27-Jan-04 9:39
Mazdak27-Jan-04 9:39 
GeneralRe: C# Web Service with Oracle Pin
Chris Meech27-Jan-04 9:51
Chris Meech27-Jan-04 9:51 
GeneralRe: C# Web Service with Oracle Pin
Mazdak27-Jan-04 10:02
Mazdak27-Jan-04 10:02 
GeneralRe: C# Web Service with Oracle Pin
Chris Meech28-Jan-04 4:07
Chris Meech28-Jan-04 4:07 
GeneralRe: C# Web Service with Oracle Pin
Mazdak28-Jan-04 4:32
Mazdak28-Jan-04 4:32 
GeneralRe: C# Web Service with Oracle Pin
Chris Meech28-Jan-04 4:46
Chris Meech28-Jan-04 4:46 
GeneralRe: C# Web Service with Oracle Pin
Guillermo Rivero27-Jan-04 10:13
Guillermo Rivero27-Jan-04 10:13 
GeneralRe: C# Web Service with Oracle Pin
Chris Meech28-Jan-04 3:34
Chris Meech28-Jan-04 3:34 
GeneralRe: C# Web Service with Oracle Pin
Guillermo Rivero28-Jan-04 4:22
Guillermo Rivero28-Jan-04 4:22 
GeneralRe: C# Web Service with Oracle Pin
Chris Meech28-Jan-04 4:58
Chris Meech28-Jan-04 4:58 
GeneralRe: C# Web Service with Oracle Pin
Chris Meech28-Jan-04 7:18
Chris Meech28-Jan-04 7:18 
GeneralRe: C# Web Service with Oracle Pin
Guillermo Rivero28-Jan-04 7:38
Guillermo Rivero28-Jan-04 7:38 
GeneralRe: C# Web Service with Oracle Pin
Chris Meech28-Jan-04 8:30
Chris Meech28-Jan-04 8:30 
GeneralRe: C# Web Service with Oracle Pin
Guillermo Rivero30-Jan-04 2:43
Guillermo Rivero30-Jan-04 2:43 

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.