-
Jul 22nd, 2014, 10:37 PM
#1
Thread Starter
Junior Member
Listbox problem.
Hello,
I have in listbox1 five names.
I want to by click on one name show on same place instead of listbox1 listbox2, with other names.
Code:
Select Case ListBox1.SelectedIndex
Case 0
(what to do there, if i want to display listbox2 on same place)
End Select
Thank you.
-
Jul 22nd, 2014, 11:14 PM
#2
Re: Listbox problem.
Can't understand the question
If you are talking about positioning the listbox then the top and left properties are the key
-
Jul 23rd, 2014, 02:39 AM
#3
Hyperactive Member
Re: Listbox problem.
Do you want to move of the index of listbox2 as same as the listbox1 when you choose item from listbox1 ?
-
Jul 23rd, 2014, 03:26 AM
#4
Thread Starter
Junior Member
Re: Listbox problem.
Essentially I need to create another Layer in program. I need to end listbox1 and instead of it get listbox2
-
Jul 23rd, 2014, 05:14 AM
#5
New Member
Re: Listbox problem.
Hi,
in my understanding, you want to show another Listbox when clicking on an entry in Listbox 1, right?
the trick is to create 2 listboxes and set lisbox2 invisible. also, it may help to use .left and .top property to move the listbox 2 to the position of listbox 1. this can be done when initializing the userform depending on what you are trying to achieve.
try sth like this (must be adopted to your needs)
Code:
Private Sub UserForm_Initialize()
'assuming listbox 1 has position .left = 10 and .top = 20
listbox2.Visible = False
listbox2.Left = 10
listbox2.Top = 20
End Sub
'and your code snippet should look like this
Select Case ListBox1.SelectedIndex
Case 0
listbox1.visible = false
listbox2.visible = true
End Select
I guess your code snippet should be located in a mouse event. Doing this, listbox1 disappears when clicking on an entry and listbox2 shows up.
--------------------------------------------------------------------
Center of Efficiency UG (haftungsbeschränkt)
www.centerofefficiency.com
-
Jul 23rd, 2014, 09:56 AM
#6
Re: Listbox problem.
Originally Posted by madmancz
Essentially I need to create another Layer in program. I need to end listbox1 and instead of it get listbox2
You really need to do a better job of wording your questions.
I still have no idea what you are trying to ask.
Layer in program? End list1? get list2?
-
Jul 23rd, 2014, 10:10 AM
#7
Hyperactive Member
Re: Listbox problem.
Originally Posted by DataMiser
You really need to do a better job of wording your questions.
I still have no idea what you are trying to ask.
Layer in program? End list1? get list2?
Is he talking about to layer garlic paste on fried chicken with some lemons ?
-
Jul 23rd, 2014, 10:24 AM
#8
Re: Listbox problem.
a Wild guess here, I believe he's trying to input a large amount of entries into a listbox and since it only supports up to a certain number of entries, he wants to display a second listbox, and place the remaining entries in it, and then make it visible only when the user scrolls down to the value of List1 (which in turn, will then go invisible).
If that indeed is the case, you can use other tools, don't get stuck with listbox.
either that, or simply have String that contain all the entries, and load into the listbox,
only half of them at a time, (have a button to load them by sections, like Page 1, Page 2, ...)
-
Jul 23rd, 2014, 10:24 AM
#9
New Member
Re: Listbox problem.
;DDD
I think he wants to do the following:
1. show listbox1 with some entries
2. when user clicks on an entry in listbox1 -> show another listbox2 instead of listbox1, thus, same size and position, but different content
example: listbox1 with first and sur name -> click on a name -> show listbox2 with addresses of name
depending on your data structure the best way might be to "refill" listbox 1, thus delete all entries when an entry was selected and then fill listbox1 with your new entries.
by doing so, you wouldn't need listbox2 at all
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
|
Click Here to Expand Forum to Full Width
|