CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Location
    India
    Posts
    215

    Selection Change of Combo Box from InitDialog

    How can I invoke the Combobox Item SelectionChange from Init Dialog.

    If I set combobox.SetCurSel(1) in InitDialog, the SelectionChange event is not invoked.

    How Can I achieve this.
    Thanks

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Selection Change of Combo Box from InitDialog

    Quote Originally Posted by kirantoday View Post
    If I set combobox.SetCurSel(1) in InitDialog, the SelectionChange event is not invoked.
    Yes, it is by design. From MSDN:
    The CBN_SELCHANGE notification message is sent when the user changes the current selection in the list box of a combo box. The user can change the selection by clicking in the list box or by using the arrow keys.
    Quote Originally Posted by kirantoday
    How Can I achieve this.
    As a "workaround" you could directly call the message handler of CBN_SELCHANGE notification.
    Victor Nijegorodov

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Selection Change of Combo Box from InitDialog

    No, SetCurSel should work. I used it frequently. You're talking about the notification message, not programatically setting the selection.

    Can you show the code you're using?

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