checkbox in listbox?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maarten

    #1

    checkbox in listbox?

    hi all

    i was wondering if it is posible to add checkboxe in a listbox
    and if so how do i do it?

    thankyou

    Maarten


  • Randy Birch

    #2
    Re: checkbox in listbox?

    Set the style property to 1-Checked.

    --


    Randy Birch
    MS MVP Visual Basic



    "Maarten" <gurkjaan@hotma il.com> wrote in message
    news:416491c8$0 $848$ba620e4c@n ews.skynet.be.. .
    : hi all
    :
    : i was wondering if it is posible to add checkboxe in a listbox
    : and if so how do i do it?
    :
    : thankyou
    :
    : Maarten
    :
    :

    Comment

    • Maarten

      #3
      Re: checkbox in listbox?

      thank you for yourre quick reply,
      i did so (set the style property to checked)
      and it looks nice

      but do you mightbe have a litle example code how to work with te box in the
      list?

      Kind regards Maarten


      "Maarten" <gurkjaan@hotma il.com> wrote in message
      news:416491c8$0 $848$ba620e4c@n ews.skynet.be.. .[color=blue]
      > hi all
      >
      > i was wondering if it is posible to add checkboxe in a listbox
      > and if so how do i do it?
      >
      > thankyou
      >
      > Maarten
      >
      >[/color]


      Comment

      • Randy Birch

        #4
        Re: checkbox in listbox?

        Private Sub Form_Load()

        Dim cnt As Long

        For cnt = 1 To 10
        List1.AddItem "Item " & cnt
        Next

        Command1.Captio n = "Get selected items"
        Command2.Captio n = "Clear selection"

        End Sub

        Private Sub Command1_Click( )

        Dim cnt As Long

        With List1

        If .SelCount > 0 Then
        For cnt = 0 To .ListCount - 1
        If .Selected(cnt) = True Then
        Debug.Print .List(cnt)
        End If
        Next
        End If

        End With

        End Sub


        Private Sub Command2_Click( )

        Dim cnt As Long

        With List1

        If .SelCount > 0 Then

        For cnt = 0 To .ListCount - 1
        .Selected(cnt) = False
        Next

        End If

        End With


        End Sub



        --


        Randy Birch
        MS MVP Visual Basic



        "Maarten" <gurkjaan@hotma il.com> wrote in message
        news:41649739$0 $861$ba620e4c@n ews.skynet.be.. .
        : thank you for yourre quick reply,
        : i did so (set the style property to checked)
        : and it looks nice
        :
        : but do you mightbe have a litle example code how to work with te box in
        the
        : list?
        :
        : Kind regards Maarten
        :
        :
        : "Maarten" <gurkjaan@hotma il.com> wrote in message
        : news:416491c8$0 $848$ba620e4c@n ews.skynet.be.. .
        : > hi all
        : >
        : > i was wondering if it is posible to add checkboxe in a listbox
        : > and if so how do i do it?
        : >
        : > thankyou
        : >
        : > Maarten
        : >
        : >
        :
        :

        Comment

        • Maarten

          #5
          Re: checkbox in listbox?

          Debug.Print

          ive seen this command being used a couple of times.
          what is this command for?

          thankyou Maarten

          "Randy Birch" <rgb_removethis @mvps.org> wrote in message
          news:COadnRGb0Z XvO_ncRVn-gw@rogers.com.. .[color=blue]
          > Private Sub Form_Load()
          >
          > Dim cnt As Long
          >
          > For cnt = 1 To 10
          > List1.AddItem "Item " & cnt
          > Next
          >
          > Command1.Captio n = "Get selected items"
          > Command2.Captio n = "Clear selection"
          >
          > End Sub
          >
          > Private Sub Command1_Click( )
          >
          > Dim cnt As Long
          >
          > With List1
          >
          > If .SelCount > 0 Then
          > For cnt = 0 To .ListCount - 1
          > If .Selected(cnt) = True Then
          > Debug.Print .List(cnt)
          > End If
          > Next
          > End If
          >
          > End With
          >
          > End Sub
          >
          >
          > Private Sub Command2_Click( )
          >
          > Dim cnt As Long
          >
          > With List1
          >
          > If .SelCount > 0 Then
          >
          > For cnt = 0 To .ListCount - 1
          > .Selected(cnt) = False
          > Next
          >
          > End If
          >
          > End With
          >
          >
          > End Sub
          >
          >
          >
          > --
          >
          >
          > Randy Birch
          > MS MVP Visual Basic
          > http://vbnet.mvps.org/
          >
          >
          > "Maarten" <gurkjaan@hotma il.com> wrote in message
          > news:41649739$0 $861$ba620e4c@n ews.skynet.be.. .
          > : thank you for yourre quick reply,
          > : i did so (set the style property to checked)
          > : and it looks nice
          > :
          > : but do you mightbe have a litle example code how to work with te box in
          > the
          > : list?
          > :
          > : Kind regards Maarten
          > :
          > :
          > : "Maarten" <gurkjaan@hotma il.com> wrote in message
          > : news:416491c8$0 $848$ba620e4c@n ews.skynet.be.. .
          > : > hi all
          > : >
          > : > i was wondering if it is posible to add checkboxe in a listbox
          > : > and if so how do i do it?
          > : >
          > : > thankyou
          > : >
          > : > Maarten
          > : >
          > : >
          > :
          > :
          >[/color]


          Comment

          • mickey

            #6
            Re: checkbox in listbox?

            On Thu, 7 Oct 2004 14:35:27 +0200, "Maarten" <gurkjaan@hotma il.com>
            you typed some letters in random order:
            [color=blue]
            >Debug.Print
            >
            >ive seen this command being used a couple of times.
            >what is this command for?
            >[/color]
            Hit CRTL-g the debug window will open.
            when you run the code, the lines and value's after the 'debug.print'
            wil apear in this window. Very helpfull for tracking your code.

            [color=blue]
            >thankyou Maarten
            >[/color]

            Groetjenz,

            Mickey
            --
            #### gewoan skrieve su ast ut seist ####

            Comment

            • Maarten

              #7
              Re: checkbox in listbox?

              thank you all for the reply

              greets Maarten

              "mickey" <mickeyATgruize lgruis.nl> wrote in message
              news:t62bm09ri0 46u95s2jiumrajk 5n2h04igl@4ax.c om...[color=blue]
              > On Thu, 7 Oct 2004 14:35:27 +0200, "Maarten" <gurkjaan@hotma il.com>
              > you typed some letters in random order:
              >[color=green]
              > >Debug.Print
              > >
              > >ive seen this command being used a couple of times.
              > >what is this command for?
              > >[/color]
              > Hit CRTL-g the debug window will open.
              > when you run the code, the lines and value's after the 'debug.print'
              > wil apear in this window. Very helpfull for tracking your code.
              >
              >[color=green]
              > >thankyou Maarten
              > >[/color]
              >
              > Groetjenz,
              >
              > Mickey
              > --
              > #### gewoan skrieve su ast ut seist ####[/color]


              Comment

              Working...