Results 1 to 2 of 2
2002-05-13, 20:29 #1
- Join Date
- May 2002
- Thanked 0 Times in 0 Posts
Excel UserForm ListBox (Windows 98 SE)
I'm in Windows 98SE using VBA to develop a UserForm for input to an Excel 2k worksheet. On the form I have several listboxes. The first line of each listbox is "choose ..."; the user selects from each list and the selected item shows up as white-on-black (reverse type). So far, so good.
But when I print the UserForm, the selected entries also print in reverse type. I want them to print black-on-white, the way the rest of the form does.
I've tried setting the BackColor and ForeColor properties of the list boxes to vbWhite and vbBlack, respectively, in the print routine, but that also sets the contents back to "choose ...".
I've also tried setting the ListStyle property to Option. The option buttons show up and print with the list item, but they still print in reverse type.
Is there a way to fix this so that the selected items print on the UserForm, but in standard black-on-white?
2002-05-14, 11:38 #2
- Join Date
- Mar 2001
- Springfield, Ohio, USA
- Thanked 1 Time in 1 Post
Re: Excel UserForm ListBox (Windows 98 SE)
Just set SelStart to 0. See sample below. HTH --Sam
Private Sub CommandButton1_Click()
.SelStart = 0
.SelLength = Len(.Text)
Private Sub UserForm_Initialize()
.ListIndex = 0
<font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
<small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>