Picturebox(or ImageButton) Visible true/false

G

Guest

I make gui form that contain many picturebox. (or imagebutton in MSDN)

This is program working step
0. Form has 30 picturebox
1. click some picturebox
2. processing my function (It takes time 10-20 second) and get return value
3. all picturebox visible = false;
4. check return value and show some picturebox visible = true;

but, my program stoped (no exeption) when processing picturebox "visible =
true/false"


Sample Code

private void aa()
{
int ret = myfunction();

if(ret = 0)
{
this.visibleFalseAll();

this.PB_Ctrl_01_Icon_01.Visible = true;
}
}

private void visibleFalseAll()
{
if(this.PB_Ctrl_01_Icon_01.Visible != false)
{
this.PB_Ctrl_01_Icon_01.Visible = false; // ramdom stop here, no exception
this.PB_Ctrl_01_Icon_01.Invalidate();
}
if(this.PB_Ctrl_01_Icon_02.Visible != false)
{
this.PB_Ctrl_01_Icon_02.Visible = false; // ramdom stop here, no exception
this.PB_Ctrl_01_Icon_02.Invalidate();
}
}

I can't solve this problem.

Please help me.
 
S

Sergey Bogdanov

Not sure that the problem in .Visible = false. Maybe one of background
threads trying to use GUI (it may cause hanging that you described)?

Best regards,
Sergey Bogdanov
 
R

Romain TAILLANDIER

I have encounter exactly the same problem on the full framewok 1.1.
May be it can help ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top