Click here to Skip to main content
16,012,759 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMenu messaging Pin
David_Leikis2-Sep-03 8:51
David_Leikis2-Sep-03 8:51 
GeneralRe: Menu messaging Pin
Dor2-Sep-03 12:30
Dor2-Sep-03 12:30 
QuestionHow to resize the MDI child window at startup Pin
mr20032-Sep-03 8:46
mr20032-Sep-03 8:46 
AnswerRe: How to resize the MDI child window at startup Pin
John R. Shaw3-Sep-03 7:12
John R. Shaw3-Sep-03 7:12 
QuestionHow do I add controls to my view? Pin
Anonymous2-Sep-03 8:37
Anonymous2-Sep-03 8:37 
AnswerRe: How do I add controls to my view? Pin
valikac2-Sep-03 9:35
valikac2-Sep-03 9:35 
GeneralRe: How do I add controls to my view? Pin
Anonymous2-Sep-03 10:20
Anonymous2-Sep-03 10:20 
AnswerRe: How do I add controls to my view? Pin
Navin2-Sep-03 10:28
Navin2-Sep-03 10:28 
There are a couple relatively easy ways, in addition to the splitter idea the other guy suggested.

1. Create a control dynamically. Have an object of, say, CButton, in your header file, and then in the view class initialization, create the button with the desired attributes. For instance:
// in header file
protected:
CButton myButton;

// in initialization function
myButton.Create(blah);

Look in MSDN for the parameters to Create, you will have size, position, caption, etc. One important one is the control ID. You can use that control ID in your message map so you can define a handler that controls what happens when the button is clicked.

2. Handle mouse clicks (e.g., OnMouseUp). Check if the mouse position is within a certain area, and then do whatever you feel like doing.

#1 is probably cleaner, since you get an actual button, but 2 is probably a little easier.




"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
GeneralHiding MDI child window at startup, check the code please Pin
mr20032-Sep-03 8:24
mr20032-Sep-03 8:24 
GeneralRe: Hiding MDI child window at startup, check the code please Pin
valikac2-Sep-03 9:38
valikac2-Sep-03 9:38 
GeneralRe: Hiding MDI child window at startup, check the code please Pin
Brian Shifrin3-Sep-03 12:08
Brian Shifrin3-Sep-03 12:08 
GeneralAutomation server help needed Pin
Gilrock2-Sep-03 8:13
Gilrock2-Sep-03 8:13 
GeneralRe: Automation server help needed Pin
Brian Shifrin3-Sep-03 12:10
Brian Shifrin3-Sep-03 12:10 
GeneralRe: Automation server help needed Pin
Gilrock3-Sep-03 12:53
Gilrock3-Sep-03 12:53 
GeneralRe: Automation server help needed Pin
igor19603-Sep-03 13:48
igor19603-Sep-03 13:48 
GeneralRe: Automation server help needed Pin
Gilrock3-Sep-03 20:07
Gilrock3-Sep-03 20:07 
GeneralRe: Automation server help needed Pin
Gilrock4-Sep-03 6:10
Gilrock4-Sep-03 6:10 
GeneralRe: Automation server help needed Pin
igor19604-Sep-03 7:05
igor19604-Sep-03 7:05 
GeneralRe: Automation server help needed Pin
Gilrock4-Sep-03 8:15
Gilrock4-Sep-03 8:15 
Generalfree(pMemory) Pin
ravingcoder2-Sep-03 8:11
ravingcoder2-Sep-03 8:11 
GeneralRe: free(pMemory) Pin
igor19602-Sep-03 8:15
igor19602-Sep-03 8:15 
GeneralRe: free(pMemory) Pin
ravingcoder2-Sep-03 8:24
ravingcoder2-Sep-03 8:24 
Generalexporting std::string Pin
Jim Crafton2-Sep-03 7:46
Jim Crafton2-Sep-03 7:46 
GeneralRe: exporting std::string Pin
cmk2-Sep-03 7:52
cmk2-Sep-03 7:52 
GeneralRe: exporting std::string Pin
Neville Franks2-Sep-03 10:01
Neville Franks2-Sep-03 10:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.