?
Solved

Changing The Caption of A button?

Posted on 1999-10-27
9
Medium Priority
?
203 Views
Last Modified: 2010-04-16
IS it posssible useing Borland c++ 5.02 owl library to change the caption of a button. All i want to do is change it form blank to eith er "X" or "O" (Im writing Tic Tac Toe). IS this possible and if it isnt what is the best way to do this. Thanks
0
Comment
Question by:ziggy_9mm
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 2162519
Hmm, obtain the window handle of the button and call 'SetEindowText()'...
0
 
LVL 22

Expert Comment

by:nietod
ID: 2162588
That would be SetWindowText().
0
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 2163069
Thanx for the correction ;-)
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 86

Expert Comment

by:jkr
ID: 2163080
Ooops, this should have been a comment (let's blame the 'new look')
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2163321
You have 2 Options:
void TCalc::UpdateDisplay()
{
  char  str[DisplayDigits + 2];
........//form str
            //1. without using TButton:
  ::SetWindowText(GetDlgItem(ID_DISPLAY), str);
                    //or
  tButton->SetWindowText(str);
         //where tButton = new TButton(this,ID_DISPLAY);// in Constructor
}
If you have more Questions about
OWL, you can ask in OWL Area.
Alex
0
 
LVL 3

Expert Comment

by:LucHoltkamp
ID: 2166051
alex, that would be:
::SetWindowText(::GetDlgItem(ID_DISPLAY), str); or better
GetDlgItem(ID_DISPLAY)->SetWindowText(str);

But why don't you make you're buttons in the resource editor? and use a dialog instead of a normal window...
Look at the examples for how to make a dialog.
Luc
0
 
LVL 3

Expert Comment

by:LucHoltkamp
ID: 2166059
Ah, wait...
You want the button to change when you click on it!
Sorry, that won't go in the resource editor...
However you could also use bitmaps, that will look a lot better.
If you want to know how, we hear from you :-)
Luc
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2166187
Luc, i see , that you use OWL many many
time ago...
0
 
LVL 1

Author Comment

by:ziggy_9mm
ID: 2167731
thanx
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

607 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