CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: PostMessage

  1. #1
    Join Date
    Oct 1999
    Location
    US
    Posts
    34

    PostMessage

    All the CB_ messages that work fine with regular comboBoxes are useless with DataCombo. Particularly I was trying to use CB_SETCURSEL.
    Is there a way to do this?
    Thanks!
    Alex!


  2. #2
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: PostMessage

    I assume that you want to make sure that a certain item in the list is visible? I dont really use the datacombo control, but i use the listindex property of the regular control all the time to automatically set the selection. Could you do something like that?
    DBCombo1.SelectedItem = DBCombo1.List(index)



    Hope this applies/helps,
    John

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  3. #3
    Join Date
    Oct 1999
    Location
    US
    Posts
    34

    Re: PostMessage

    Good idea! Thanks! However the .List and .ItemSelected properties are not available for DataCombo1 (not DBCombo1).
    DataCombo1 is ADO thing. The only thing I can do is to change .Text property. This will triger
    change event. Hovewer the selected item will only
    change if I would say something like:

    DataCombo1.Text = 5



    And this wouldn't work.

    lVal = 5
    DataCombo1.Text = lVal



    Almost like it consider 5, lVal as objects. It can find 5 and not lVal. Do you know how to go arraund this?
    Thank you!
    Alex!


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

Featured