Board index » cppbuilder » 3 images on a form

3 images on a form


2004-12-24 01:48:44 AM
cppbuilder102
Hi,
I have three images on my form
I want only one to be visible at a time.
Which image is visible is selected by a menu option.
void __fastcall TMyForm::DeviceClick(TObject *Sender)
{
image->Hide();
image2->Hide();
image3->Hide();
item1->Checked = FALSE;
item2->Checked = FALSE;
item3->Checked = FALSE;
((TMenuItem*)Sender)->Checked = TRUE;
if( item1->Checked )
image1->Show();
else if( item2->Checked )
image2->Show();
else if( item3->Checked )
image3->Show();
Repaint();
}
Initially the images are set to visible = false
I get nothing until I minimise & maximise the form.
what do I have to do to force repaint to redraw the entire form??
I can't find anything in the VCL help file...
Thanks.
The
 
 

Re:3 images on a form

Stephan wrote:
Quote
Repaint();
That statement is not needed. Your code just works here,
Quote
I get nothing until I minimise & maximise the form.
what do I have to do to force repaint to redraw the entire form??
I do not understand that the whole form should be repainted.
On would think that one image becomes visible and another becomes
unvisible. The code does that.
Hans.
 

Re:3 images on a form

"Hans Galema" < XXXX@XXXXX.COM >wrote in message
Quote
On would think that one image becomes visible and another becomes
unvisible. The code does that.
I would hope so, but that is not the case. after
I maximize the form, the proper image is shown.
when I pick a new item, the old image remains
until I min / max again.
I didn't mention it, but maybe it's significant.
The main form is MDI. I have no children spawned
when I test this.
 

{smallsort}

Re:3 images on a form

Stephan wrote:
Quote
I didn't mention it, but maybe it's significant.
The main form is MDI.
And the images are on that mainform ?
To know if MDI is significant you could find out yourself.
Please check first with a non fsMDIForm.
Hans.
 

Re:3 images on a form

"Hans Galema" < XXXX@XXXXX.COM >wrote in message
Quote
Stephan wrote:

>I didn't mention it, but maybe it's significant.
>The main form is MDI.

And the images are on that mainform ?

To know if MDI is significant you could find out yourself.
Please check first with a non fsMDIForm.
yes, images on main form.
won't get a chance to look at it until jan 3..
until then, merry xmas, happy new year.