Re: [WIN] "open" simple combo box programmatically
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Oct 20, 2000
- 546 views
Derek, Hmm, you might be right. But just in case I'm having trouble explaining myself, too, :) I have one combo box full of *categories*; as a Simple Combo box, it starts life as a small, single little box with one line of text in it (the first item in the hidden list), and a little arrow thingy at the right side of the single line of text; if user clicks on the little arrow thingy, the first combo box "opens" & shows its list; if the user then *selects* one of the items in the first combo boxes list, the list disappears and the item selected is shown in the single little "edit" box; and, the *second* combo box is now populated with the appropriate elements relating to the selected category in the first combo box, and the first element in the second combo shows up in its single one line box; what I would *like* is that when the user has done the above, the *second* combo box would automatically open & display its *list*, so the user could then *select* from the items in it immediately, instead of having to click first on the item in the combo boxes single line. I suspect that the list box would or could work, but the combo box does almost everything *automatically* (it sizes to the number of elements, as long as you specify the *max* size expected), except for the unfolding; so if I could get it to unfold automatically, simply, then I don't have to do all the rest. So if there's a "secret" command that would force the combo box to display its list, I'd rather use that; if not, then I'll do it your way :) Thanks, Dan ----- Original Message ----- From: "Derek Parnell" <dparnell at BIGPOND.NET.AU> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Friday, October 20, 2000 6:05 AM Subject: Re: [WIN] "open" simple combo box programmatically > Sorry Dan, its my fault. I didn't express myself very clearly. > > I'm suggesting that you drop the idea of using a COMBOBOX for the second > list, and instead use a LISTBOX control. Then programatically control the > visualisation of it so that it "unfolds" by changing its height and "folds" > again also by changing its height. > In other words, why do you want the user to click on the second box? My > guess is that you don't actually want that. Instead you want the user to see > the contents at all times - without clicking. > > The pseudo code would go something like this... > > onClick_FirstBox: > get item in first box. > clear second box. > set height of second box to one char high. > add items to second box based on item in first box. > set height of second box so that 'x' lines are visible. > if 'x' < actual number of items, set a vertical scrollbar > for the second box. > end onClick. > > This would give the impression that the second box is automatically > expanding/contracting based on its contents. There is no need to click on > anything. Just use a LISTBOX rather than a COMBOBOX. > > ----- > cheers > Derek > > ------ > Derek Parnell > Melbourne, Australia > (Vote [1] The Cheshire Cat for Internet Mascot) > > ----- Original Message ----- > From: "Dan B Moyer" <DANMOYER at PRODIGY.NET> > To: <EUPHORIA at LISTSERV.MUOHIO.EDU> > Sent: Friday, October 20, 2000 6:38 PM > Subject: Re: [WIN] "open" simple combo box programmatically > > > > Derek, > > > > No, that's not it, (I think), the size seems to be working automatically > and > > just fine, as each new list of items is put into the second list on > choosing > > a category from the first, the first element of that list shows up in the > > "edit" portion of the second; if the user *clicks* on that displayed > > element, *then* the list "unfolds" to show all elements, and it does so > just > > fine, it's a big box for many items, and a small box for few. It's the > > "unfolding" I'm trying to cause programmatically as soon as an item > > (category) is clicked on in the first. > > > > My ISP is doing maintenance & will stop sending me email in about a half > > hour. > > > > Dan > > > > > > ----- Original Message ----- > > From: "Derek Parnell" <dparnell at BIGPOND.NET.AU> > > To: <EUPHORIA at LISTSERV.MUOHIO.EDU> > > Sent: Friday, October 20, 2000 12:28 AM > > Subject: Re: [WIN] "open" simple combo box programmatically > > > > > > > It sounds like the second box needs to be a list box who's height you > > > control programatically. Each time a category is selected in the first > > box, > > > clear the second one and populate it with the related data and > recalculate > > > it's height. You can set a maximum height and add a scroll bar if > > required. > > > > > > ------ > > > Derek Parnell > > > Melbourne, Australia > > > (Vote [1] The Cheshire Cat for Internet Mascot) > > > > > > ----- Original Message ----- > > > From: "Dan B Moyer" <DANMOYER at PRODIGY.NET> > > > To: <EUPHORIA at LISTSERV.MUOHIO.EDU> > > > Sent: Friday, October 20, 2000 6:20 PM > > > Subject: [WIN] "open" simple combo box programmatically > > > > > > > > > > Is it possible to "open" a simple combo box programmatically? > > > > > > > > By that I mean, if you have a simple combo box and you click on the > > > element > > > > of the list that's displayed in the "edit" box portion of it, then the > > > > *list* unfolds & is displayed; but can you force it to "open" or > > "unfold" > > > > programmatically? > > > > > > > > I have two related combo boxes, one has *categories* of things, the > > other > > > is > > > > then populated with the appropriate things depending on what category > is > > > > chosen, but I want the second combo box to automatically unfold when a > > > > category is chosen in the first combo box. Can this be done, & if so > > how? > > > > > > > > Dan Moyer