|
-
Nov 21st, 2000, 06:00 PM
#1
Thread Starter
Lively Member
Hi,
I think this question might have been asked before but i would like to have solution to this.
How can we align a text in Combo Box like Center,Left,Right similar to that in textbox.Can anyone tell give me solution to this???
Any help will be highly appreciated
Regards
-
Nov 21st, 2000, 10:18 PM
#2
Lively Member
Since there is no alignment property in a combo box, you'll have to fake it. Do that using the SPACE function, like so...
Code:
' This routine forces the items in the Combo Box to right-alignment
' You can use the same kind of idea to force center-alignment
'
cboMyCombo.Clear
cboMyCombo.AddItem SPACE(30-Len("Washington")) & "Washington"
cboMyCombo.AddItem SPACE(30-Len("Lincoln")) & "Lincoln"
cboMyCombo.AddItem SPACE(30-Len("Roosevelt")) & "Roosevelt"
'
I haven't tried this, so you might have to go to a non-proportional font (like Courier) to get the results you want. The "30" in the code refers to a maximum possible length of Presidential names.
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
|