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

x
?
Solved

Changing a Group Box Caption...

Posted on 1998-03-11
5
Medium Priority
?
361 Views
Last Modified: 2013-11-19
I think this is a simple thing to do, but I can't seem to get it working.  I am trying to change the caption that
appears at the top of a Group Box control at run time.  How do I reference the Group Box since it doesn't appear
as a control on my Dialog Box (even though it is there) when viewing it using the ClassWizard (under the
"Member Variables" tab)?  Since it doesn't appear as a control, I can't assign it a name like I can with a
ListBox or Button.  Any ideas?
0
Comment
Question by:tdiamond
[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
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:tflai
ID: 1316925
Change your group box resource ID to something like IDC_GBOX.  GetDlgItem(IDC_GBOX)->SetWindowText("Blah, Blah, Blah.");
0
 

Author Comment

by:tdiamond
ID: 1316926
I tried that, and the program dies, reporting that my program performed an illegal operation.  Any ideas why that might be happening?
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1316927
It seems like you are trying to set the caption before the window exists. You should do this in OnInitDialog AFTER you call the base class. Confirm that GetDlgItem() returns a NON-NULL value.

0
 

Author Comment

by:tdiamond
ID: 1316928
Sorry, the first answer proposed from tflai should of worked.  It was my fault.  I left the static control's resource ID as IDC_STATIC instead of changing it to something like ID_STATIC.  It works fine now.

Thanks everyone...
0
 
LVL 4

Expert Comment

by:tflai
ID: 1316929
Oop!  There goes the points...  :-(
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 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