Solved

popupmenu control

Posted on 2000-03-20
2
186 Views
Last Modified: 2013-12-26
Now that I created the PopUpMenu Control using NewControl(), how do I get the results of a mouseDown in the popUpMenu? I tried this but doesn't seem to work, value doesn't change

if(hitControlHdl == gWindowPeek->popUpControl) {
                      if(dummy = TrackControl(hitControlHdl,myPoint, nil)) {
                            beep;
                            value = GetControlValue((ControlHandle)gWindowPeek->popUpControl);                                  
                      }
                }
0
Comment
Question by:dwp090598
2 Comments
 
LVL 4

Accepted Solution

by:
Alex Curylo earned 100 total points
ID: 2638507
It does get as far as beeping, right? If not then "myPoint" is probably not the same point you passed to FindControl(), which it should be.

But if it is beeping, and you saw the menu item flash appropriately, hmmmm, that really ought to work. About the only reason it wouldn't is that the Control Manager is confused about how many items are in the menu. Try setting

SetControlMaximum(gWindowPeek->popUpControl, CountMItems(itsMenu));

right after creating the control -- AND after any change you make to the contents of the menu while it's part of the control, because the Control Manager does NOT automatically know about any change to the menu.

Hope that helps.
0
 

Author Comment

by:dwp090598
ID: 2641887
SetControlMaximum() did the trick.

Thanks Again
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now