HighTechTalks DotNet Forums  

Problems with picturebox

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss Problems with picturebox in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
indubidu
 
Posts: n/a

Default Problems with picturebox - 08-13-2005 , 06:12 AM







Hi,

first, sorry for my BAD english.
I come from the JAVA pogramming and now I try to programming in J#. M
problem, I have 3 classes, a ControlClass(with a button) and
ViewClass(with a picturebox, declared as public) and the MainClass(
form that contains the ControllClass and the ViewClass).
With the button i will change the image in the picturebox, but i
dosn't work.
//here some code from the ControllClass
//global declaration
...
public Forum.View view;

//Constructor
...
view = new Forum.View();

//button1_click
private void button1_Click (Object sender, System.EventArgs e)
{
view.pictureBox1.set_Image(Image.FromFile("pic.jpg "));
}
The problem, the picturebox will not update/repaint.
I hope there is anybody with a god idea.

thanks for your help
invio

the attachment-function dosn't work, so i can't show you the ful
sourcecod

--
indubid



Reply With Quote
  #2  
Old   
Sushovan
 
Posts: n/a

Default RE: Problems with picturebox - 08-15-2005 , 03:41 AM






Dear indubidu,
If you wish to force a picturebox to repaint itself, call Refresh() on it,
like

pictureBox1.Refresh();

If this does not work, make sure that the pictureBox is visible on the
MainClass form - one quick way to check this is to set the BackColor property
of the pictureBox to Color.Red, so that if it is rendered on the form, you
will be able to see it.

--
Sushovan, a crazy junior


"indubidu" wrote:

Quote:
Hi,

first, sorry for my BAD english.
I come from the JAVA pogramming and now I try to programming in J#. My
problem, I have 3 classes, a ControlClass(with a button) and a
ViewClass(with a picturebox, declared as public) and the MainClass(a
form that contains the ControllClass and the ViewClass).
With the button i will change the image in the picturebox, but it
dosn't work.
//here some code from the ControllClass
//global declaration
...
public Forum.View view;

//Constructor
...
view = new Forum.View();

//button1_click
private void button1_Click (Object sender, System.EventArgs e)
{
view.pictureBox1.set_Image(Image.FromFile("pic.jpg "));
}
The problem, the picturebox will not update/repaint.
I hope there is anybody with a god idea.

thanks for your help
invio

the attachment-function dosn't work, so i can't show you the full
sourcecode


--
indubidu




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.