[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ComboBox problem

Posted on 2000-04-01
5
Medium Priority
?
366 Views
Last Modified: 2013-11-20
I have MyComboBox owner-draw control.
In OnDropDown I do SetCurSel(-1), because I want to scroll my window by myself. Then I post my user message.
I select an item in my user message (works OK), but after UserMessage has finished, item is unselected!!!! How could I select an item in UserMessage function?
I can't use SetCurSel or SetTopIndex because they autoscroll window.
Thanks all!

void CMyComboBox::OnDropdown()
{
   ...
   SetCurSel(-1);
   PostMessage(WM_USERMESSAGE);
}

void CODComboBoxDB::OnUserMessage(...)
{
   m_MyListBox.SetCurSel(x)
}
0
Comment
Question by:si124
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Expert Comment

by:kkarunakar
ID: 2676404
Hello there,
In Place of message please try to add one function and try same.
If u r using message pls do PeekMessage also.
Try this.Hope this will work
U r comment is welcomed ..
Regards keshav
0
 

Author Comment

by:si124
ID: 2677462
Thank you for your help!
What did you mean "try to add one function"?
I don't know how to use PeekMessage in this case. Would you like to explain....
0
 

Author Comment

by:si124
ID: 2684887
Adjusted points from 100 to 150
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2685249
Hi si124:
   By any chance, did you add m_MyListBox via ClassWizard or did you manually add it?  IF you manually added it then you most likely forgot to add the necessary info into the DDX part of your class.  For example you should add to the DoDataExchange function something like
DDX_Control(pDX,IDC_COMBO1,m_MyListBox);
   Glenn  
0
 

Accepted Solution

by:
thirumaran earned 300 total points
ID: 2693017
Add GetFocus() function to bring the focus back to combobox
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question