Problem making panels visible/invisible

  • Thread starter Thread starter Jan van Schalkwyk
  • Start date Start date
J

Jan van Schalkwyk

Hi,

I have a few PictureBoxes on a Panel. At startup, the panel is invisible.
At some stage pictures are loaded into the Pictureboxes, and I then make the
Panel visible. The whole panel is not repainted, and no controls (images,
or labels) are visible - sometimes I can see my development environment
through the panel. After making the panel visible the app stops responding.

Everything works fine if the panel is visible from the start....

(I'm using C#; .NET Framework 1.1)

(I'm actually using a devExpress Grid + devExpress PictureEdit Controls - I
get the same problem with the grid (which is on a separate panel) as
well.... I though the problem might be with the devExpress controls, but
could easily recreate the problem with standard controls)

Thanks!
Jan van Schalkwyk
 
I realized the cause has something to do with a remote trigger, so I
reposted my question to the "remoting" group...

Hi,

I have a remote trigger object that is instanced the moment my local app
starts up. I then assign a local event handler to my remote object:

eventhandler = new ScaleUIEventHandlers(); //this is a
MarshalByRefObject
eventhandler.UINotificationHandler = new VASNotification(ScaleNotify);
//point to my local event handler - see below
RemotingServices.Marshal(eventhandler, myURI);
eventhandler.RegisterInterface(ScaleVASI, typeof(ScaleUIEventHandlers));
(I hope this is a valid way to trigger a local method from a remote object?
At first I only fired the event from the remote object, but no error was
returned if the link was broken and the trigger never handled....by
accessing the method directly I get a remote exception if the local object
died...)


I simplified the ScaleNotify handler to be: (The PictureBoxe is populated,
and theparent panel is made visible) THIS PANEL1 IS INVISIBLE ON STARTUP.

public void ScaleNotify(VASNotificationArgs args)
{
pic1.Image = new Bitmap("c:\\tbmp.bmp");
panel1.Visible = true; //Visible = false initially
}

This does not work - the panel is not repainted, and the app stops
responding - if you move the form, you could see the development environment
where the panel is supposed to be....

WHAT DOES WORK:
* If I call ScaleNotify locally when I press a button it works fine.
* If panel1 is VISIBLE on startup, it works fine with the remote trigger!

Hope somebody can help me!
Jan van Schalkwyk
 
Back
Top