Results 1 to 4 of 4

Thread: combo box catch 22?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    Hi,

    I'm setting up a combo box on my form but I'm running into the following catch 22 situation:

    I don't want the user to be able to type anything in the box so I set it to the "Dropdown List" style which seems to prevent the user from typing in text. However, with this style, it won't let me set anything for .Text. The idea is that I want the combo box to initially say "Select view..." so the user know what the heck the combo box is for...But, I can't seem to figure out how to get text to show in the combo box when the form is loaded.. The only way to do this seems to be when you set the style back to "Dropdown Combo", but again, the user is allowed to enter text, which I want to prevent..

    Any help would be appreciated..

    Dan

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Just set the comboxbox Locked to true
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Well two possible things:

    1) Keep it's style at the dropdown list and put a label above it to let them know what to do.

    2) Switch it back and do the following:

    Code:
    Private Sub Form_Load()
    Combo1.AddItem "Select View"
    For i = 1 To 11
    Combo1.AddItem i
    Next
    Combo1.ListIndex = 0
    End Sub
    Then add error code so that if they select it, it does nothing. However option 1 works best in my opinion.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  4. #4
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Then again, the best bet is Locking it as HeSaidJoe has stated... I didn't think of that
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

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