Results 1 to 2 of 2

Thread: Alignment in Combo box......

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Chicago
    Posts
    97
    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
    Anil

  2. #2
    Lively Member
    Join Date
    Nov 2000
    Posts
    82
    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
  •  



Click Here to Expand Forum to Full Width