-
ListBox - Mover
Is there any listbox type controls using which I can change the order of the
items and also select an item (by check marking)?
I know the standard listbox has a select method but NO order change method.
Thanks in advance,
RK.
-
Re: ListBox - Mover
rkbnair,
What are you using? in VB 6.0, the ListBox control has a Sorted Property.
You can set it at design time, or at runtime.
How are you populating the ListBox, is it a bound control, or are you using
code?
If bound, is it bound to a table, or a query?
If a Query, can't you change the sort order of the query? If a Table, then
create a query to retrieve the values from the table, and set the sort order
in the query.
Also, with the standard listbox control, change the style to CheckBox, and
you will get a checkbox for each line to indicate that it was selected.
Arthur Wood
"rkbnair" <rkannale@solus1.oceaneering.com> wrote:
>
>Is there any listbox type controls using which I can change the order of
the
>items and also select an item (by check marking)?
>
>I know the standard listbox has a select method but NO order change method.
>
>Thanks in advance,
>
>RK.
>
>
-
Re: ListBox - Mover
Arthur,
I'm sorry, I didn't explain it correctly. I want the end user be able to
change the order of the items in the list box. May be by clicking and dragging
items or so.
Sorry for that, and thank you.
RK.
"ArthurWood" <wooda@saic-trsc.com> wrote:
>
>rkbnair,
> What are you using? in VB 6.0, the ListBox control has a Sorted Property.
> You can set it at design time, or at runtime.
>
>How are you populating the ListBox, is it a bound control, or are you using
>code?
>
>If bound, is it bound to a table, or a query?
>
>If a Query, can't you change the sort order of the query? If a Table, then
>create a query to retrieve the values from the table, and set the sort order
>in the query.
>
>
>Also, with the standard listbox control, change the style to CheckBox, and
>you will get a checkbox for each line to indicate that it was selected.
>
>Arthur Wood
>"rkbnair" <rkannale@solus1.oceaneering.com> wrote:
>>
>>Is there any listbox type controls using which I can change the order of
>the
>>items and also select an item (by check marking)?
>>
>>I know the standard listbox has a select method but NO order change method.
>>
>>Thanks in advance,
>>
>>RK.
>>
>>
>
-
Re: ListBox - Mover
Arther, it is again me.
Yes I'm using vb 6.0
Thanks
"ArthurWood" <wooda@saic-trsc.com> wrote:
>
>rkbnair,
> What are you using? in VB 6.0, the ListBox control has a Sorted Property.
> You can set it at design time, or at runtime.
>
>How are you populating the ListBox, is it a bound control, or are you using
>code?
>
>If bound, is it bound to a table, or a query?
>
>If a Query, can't you change the sort order of the query? If a Table, then
>create a query to retrieve the values from the table, and set the sort order
>in the query.
>
>
>Also, with the standard listbox control, change the style to CheckBox, and
>you will get a checkbox for each line to indicate that it was selected.
>
>Arthur Wood
>"rkbnair" <rkannale@solus1.oceaneering.com> wrote:
>>
>>Is there any listbox type controls using which I can change the order of
>the
>>items and also select an item (by check marking)?
>>
>>I know the standard listbox has a select method but NO order change method.
>>
>>Thanks in advance,
>>
>>RK.
>>
>>
>
-
Re: ListBox - Mover
Check out the controls over at ccrp. One of the guys there wrote one.. I
forget who it was now, I think Karl. Anyway, http://www.mvps.org/ccrp
There are a lot of great controls there.
"rkbnair" <rkannale@solus1.oceaneering.com> wrote in message
news:3a42227c$1@news.devx.com...
>
> Is there any listbox type controls using which I can change the order of
the
> items and also select an item (by check marking)?
>
> I know the standard listbox has a select method but NO order change
method.
>
> Thanks in advance,
>
> RK.
>
>
-
Re: ListBox - Mover
You could always add a button (Labelled "Sort") and then in its click event,
Private Sub cmdSort_Click()
' this will toggle the Sorted Property
ListBox1.Sorted = Not ListBox1.Sorted
end Sub
will this accomplish what you need. Otherwise check out ccrp as another
poster suggested.
Arthur Wood
"rkbnair" <rkannale@solus1.oceaneering.com> wrote:
>
>Arther, it is again me.
>
>Yes I'm using vb 6.0
>
>Thanks
>
>"ArthurWood" <wooda@saic-trsc.com> wrote:
>>
>>rkbnair,
>> What are you using? in VB 6.0, the ListBox control has a Sorted Property.
>> You can set it at design time, or at runtime.
>>
>>How are you populating the ListBox, is it a bound control, or are you using
>>code?
>>
>>If bound, is it bound to a table, or a query?
>>
>>If a Query, can't you change the sort order of the query? If a Table,
then
>>create a query to retrieve the values from the table, and set the sort
order
>>in the query.
>>
>>
>>Also, with the standard listbox control, change the style to CheckBox,
and
>>you will get a checkbox for each line to indicate that it was selected.
>>
>>Arthur Wood
>>"rkbnair" <rkannale@solus1.oceaneering.com> wrote:
>>>
>>>Is there any listbox type controls using which I can change the order
of
>>the
>>>items and also select an item (by check marking)?
>>>
>>>I know the standard listbox has a select method but NO order change method.
>>>
>>>Thanks in advance,
>>>
>>>RK.
>>>
>>>
>>
>
-
Re: ListBox - Mover
Put a ListBox in a new project (leave its Name as the default of List1).
Paste this code into the Form's code window and Run the project.
********START PASTE********
Dim DragIndex As Long
Private Sub Form_Load()
With List1
For X = 0 To 30
.AddItem "Item #" & CStr(X + 1)
Next
End With
End Sub
Private Sub List1_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
With List1
DragIndex = .ListIndex
End With
End Sub
Private Sub List1_MouseUp(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
With List1
If DragIndex <> .ListIndex Then
ListText = .List(DragIndex)
.RemoveItem DragIndex
.AddItem ListText, .ListIndex
.ListIndex = .NewIndex
End If
End With
End Sub
********END PASTE********
Now click on an item and move your cursor to a new spot in the list. When
you release the mouse button, the item will be moved to the location of the
mouse indicator. Was that the functionality you were after?
Rick
"rkbnair" <rkannale@solus1.oceaneering.com> wrote in message
news:3a423a01$1@news.devx.com...
>
> Arthur,
> I'm sorry, I didn't explain it correctly. I want the end user be able to
> change the order of the items in the list box. May be by clicking and
dragging
> items or so.
>
> Sorry for that, and thank you.
>
> RK.
>
>
> "ArthurWood" <wooda@saic-trsc.com> wrote:
> >
> >rkbnair,
> > What are you using? in VB 6.0, the ListBox control has a Sorted
Property.
> > You can set it at design time, or at runtime.
> >
> >How are you populating the ListBox, is it a bound control, or are you
using
> >code?
> >
> >If bound, is it bound to a table, or a query?
> >
> >If a Query, can't you change the sort order of the query? If a Table,
then
> >create a query to retrieve the values from the table, and set the sort
order
> >in the query.
> >
> >
> >Also, with the standard listbox control, change the style to CheckBox,
and
> >you will get a checkbox for each line to indicate that it was selected.
> >
> >Arthur Wood
> >"rkbnair" <rkannale@solus1.oceaneering.com> wrote:
> >>
> >>Is there any listbox type controls using which I can change the order of
> >the
> >>items and also select an item (by check marking)?
> >>
> >>I know the standard listbox has a select method but NO order change
method.
> >>
> >>Thanks in advance,
> >>
> >>RK.
> >>
> >>
> >
>
-
Re: ListBox - Mover
Appreciate the recommend, George, but the DragList style is incompatable with
Checkboxes. Wish it weren't so, but it is.
--
http://www.mvps.org/vb
"George Handlin" <handling@nospam.home.com> wrote in message
news:3a424739@news.devx.com...
> Check out the controls over at ccrp. One of the guys there wrote one.. I
> forget who it was now, I think Karl. Anyway, http://www.mvps.org/ccrp
>
> There are a lot of great controls there.
>
>
> "rkbnair" <rkannale@solus1.oceaneering.com> wrote in message
> news:3a42227c$1@news.devx.com...
> >
> > Is there any listbox type controls using which I can change the order of
> the
> > items and also select an item (by check marking)?
> >
> > I know the standard listbox has a select method but NO order change
> method.
> >
> > Thanks in advance,
> >
> > RK.
> >
> >
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks