Click here to Skip to main content
16,007,163 members
Home / Discussions / C#
   

C#

 
AnswerRe: Customizing controls Pin
AB777121-Feb-06 21:09
AB777121-Feb-06 21:09 
GeneralRe: Customizing controls Pin
madhusri21-Feb-06 21:38
madhusri21-Feb-06 21:38 
GeneralRe: Customizing controls Pin
AB777121-Feb-06 21:43
AB777121-Feb-06 21:43 
Questionregistry Pin
papa198021-Feb-06 19:37
papa198021-Feb-06 19:37 
AnswerRe: registry Pin
gnjunge21-Feb-06 23:26
gnjunge21-Feb-06 23:26 
GeneralRe: registry Pin
papa198022-Feb-06 3:20
papa198022-Feb-06 3:20 
GeneralRe: registry Pin
gnjunge22-Feb-06 6:14
gnjunge22-Feb-06 6:14 
Questionchange of size of PictureBox? (error in code, or in .NET2.0?) Pin
dorwin21-Feb-06 19:18
dorwin21-Feb-06 19:18 
Hi,

I have a simple project in WinForms (C# Express) .NET 2.0:

vo form I have inserted panel (panel1) and in panel there is PictureBox1

Panel1 has property Dock = Fill

PictureBox1 has property Dock = Top

on Resize event for picturebox I have:

/*----------------------------------------------------------------------*/
1 private void pictureBox1_Resize(object sender, EventArgs e)
2 {
3 Image newImg = new Bitmap(panel1.Width ,panel1.Height );
4 if (PictureBox1 != null)
5 {
6 if (PictureBox1.Image != null)
7 {
8 PictureBox1.Image.Dispose();
9 PictureBox1.Image = null;
10 }
11 PictureBox1.Image = newImg;
12 }
13 }
/*----------------------------------------------------------------------*/

After maximalisation of forrm has PictureBox unchanged size, although there is Dock property set to "Top".

When I comment line #11, everything works fine.
Why? I need to create image in PictureBox dinamically after each resizing of picturebox. However size of picturebox is not affected, and the worse it do something bad with Dock feature..

In .NET 1.1. it worked perfectly, however in .NET 2.0 it doesn't.

projekt is saved here: http://www.tekl.com/testform1.zip

( has 36kb).


Thank you for any help. I don't know, what to do.

AnswerRe: change of size of PictureBox? (error in code, or in .NET2.0?) Pin
Robin Panther21-Feb-06 22:44
Robin Panther21-Feb-06 22:44 
GeneralRe: change of size of PictureBox? (error in code, or in .NET2.0?) Pin
dorwin21-Feb-06 23:02
dorwin21-Feb-06 23:02 
Questionhandling unicode Pin
cshivaprasad21-Feb-06 17:48
cshivaprasad21-Feb-06 17:48 
AnswerRe: handling unicode Pin
Christian Graus21-Feb-06 17:54
protectorChristian Graus21-Feb-06 17:54 
GeneralRe: handling unicode Pin
cshivaprasad21-Feb-06 18:45
cshivaprasad21-Feb-06 18:45 
AnswerRe: handling unicode Pin
Malli_S22-Feb-06 1:45
Malli_S22-Feb-06 1:45 
GeneralRe: handling unicode Pin
cshivaprasad22-Feb-06 2:19
cshivaprasad22-Feb-06 2:19 
AnswerRe: handling unicode Pin
Christian Graus21-Feb-06 17:56
protectorChristian Graus21-Feb-06 17:56 
GeneralRe: handling unicode Pin
Le centriste22-Feb-06 1:22
Le centriste22-Feb-06 1:22 
Questionwhy do i get "object reference not set to an instance of an object" Pin
aqui_i21-Feb-06 16:07
aqui_i21-Feb-06 16:07 
AnswerRe: why do i get "object reference not set to an instance of an object" Pin
Christian Graus21-Feb-06 16:15
protectorChristian Graus21-Feb-06 16:15 
QuestionAbout Windows Service. Pin
tianwei0221-Feb-06 16:04
tianwei0221-Feb-06 16:04 
Questiondeserialize to C# class from external config file? Pin
Tom Paluzzi21-Feb-06 15:50
Tom Paluzzi21-Feb-06 15:50 
QuestionUgh! Property Grid Pin
gantww21-Feb-06 14:01
gantww21-Feb-06 14:01 
QuestionNeed Help Creating Pop Up WinForm Pin
ilan_dalal21-Feb-06 11:55
ilan_dalal21-Feb-06 11:55 
AnswerRe: Need Help Creating Pop Up WinForm Pin
KaptinKrunch21-Feb-06 12:17
KaptinKrunch21-Feb-06 12:17 
QuestionRe: Need Help Creating Pop Up WinForm Pin
ilan_dalal21-Feb-06 23:49
ilan_dalal21-Feb-06 23:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.