Picturebox(or ImageButton) Visible true/false

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
I have encounter exactly the same problem on the full framewok 1.1.
May be it can help ....
 
Back
Top