Click here to Skip to main content
15,923,083 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Pointers and arrays problem Pin
Paul Conrad3-Dec-08 4:48
professionalPaul Conrad3-Dec-08 4:48 
AnswerRe: Pointers and arrays problem Pin
Paul Conrad3-Dec-08 4:49
professionalPaul Conrad3-Dec-08 4:49 
NewsReceive Windows 7 Beta 1 at a Local MSDN Developer Conference Pin
concordmfg2-Dec-08 12:24
concordmfg2-Dec-08 12:24 
QuestionNotSupportedException Pin
Developer6112-Dec-08 10:16
Developer6112-Dec-08 10:16 
AnswerRe: NotSupportedException Pin
Dave Kreskowiak2-Dec-08 10:41
mveDave Kreskowiak2-Dec-08 10:41 
GeneralRe: NotSupportedException Pin
Member 53148902-Dec-08 18:40
Member 53148902-Dec-08 18:40 
GeneralRe: NotSupportedException Pin
Dave Kreskowiak3-Dec-08 1:46
mveDave Kreskowiak3-Dec-08 1:46 
QuestionDynamic picturebox allocation Pin
Umangj2-Dec-08 8:08
Umangj2-Dec-08 8:08 
I am creating n pictureboxes and then setting a different image on each one of them in a loop. The user clicks on open n opens a .zip file (containing images only). I am unzipping the .zip contents in a folder and am able to extract the images from there.For the first time the pictureboxes rightly shows the images. But when again user click on the open button and select a .zip file to be opened. The new images doesnt appear completely.

Problem could be: previous images are not getting removed so are not allowing the new images to appear.
Language: c#
code:
pb = new PictureBox[r*c];
            Point point = new Point(100, 100);
         
            //pb.Image = null;

            for (i = 0; i < r * c; i++)
            {
                pb[i] = new PictureBox();
               
                {
                    pb[i].Dispose();
                }
                
                pb[i].Image = null;
            }
            int w = 800 / r;
            int k = 0;
            int h = 700 / c;
            int a = w, b = h;
            for (i1 = 0; i1 < r; i1++)
            {
                b = 15;
                for (i2 = 0; i2 < c; i2++)
                {
                    
                   // this.TransparencyKey = Color.Transparent;
                    //pb.BackColor = Color.Transparent;
                    pb[k] = new PictureBox();
                    pb[k].Image = null;        
                    pb[k].Size = new Size(w, h);
                    this.Controls.Add(pb[k]);
                    if (i1 == 0 )
                    {
                        pb[k].Location = new Point(10, b);
                    }
                    else
                    {
                        pb[k].Location = new Point(a, b);
                    }
                    //a = a + w;
                    b = b + h;
                    Bitmap img=new Bitmap("d:\\puzzlesolver\\pieces\\piece"+i2.ToString()+i1.ToString()+".png");
                    Bitmap img1 = new Bitmap(img);
                    pb[k].Image = img1;
                    pb[k].SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
                    pb[k++].Update();
                    this.Update();
                   // img.Dispose();
                    
                }
                a = a + w;
            }
            this.Update();


I have tried a lot of things please tell me how to remove the existing picture boxes which are dynamically allocated and then add them again. I hope m clear!!
QuestionPls Reply guyz Pin
Umangj3-Dec-08 2:43
Umangj3-Dec-08 2:43 
AnswerRe: Pls Reply guyz Pin
Paul Conrad3-Dec-08 4:52
professionalPaul Conrad3-Dec-08 4:52 
AnswerRe: Dynamic picturebox allocation Pin
Gideon Engelberth3-Dec-08 3:20
Gideon Engelberth3-Dec-08 3:20 
GeneralRe: Dynamic picturebox allocation Pin
Umangj3-Dec-08 15:35
Umangj3-Dec-08 15:35 
QuestionVB6 to VB.NET - DLL function arguments conversion Pin
boris.sclauzero2-Dec-08 6:00
boris.sclauzero2-Dec-08 6:00 
QuestionDoubt on Textbox Control !!!!! Pin
Suave_Shiva1-Dec-08 17:32
Suave_Shiva1-Dec-08 17:32 
AnswerRe: Doubt on Textbox Control !!!!! Pin
Simon P Stevens1-Dec-08 22:51
Simon P Stevens1-Dec-08 22:51 
GeneralRe: Doubt on Textbox Control !!!!! Pin
TJS4u4-Dec-08 19:10
TJS4u4-Dec-08 19:10 
QuestionDataTable.Update throws "duplicate value cannot be inserted into a unique index" Pin
gongchengshi1-Dec-08 12:24
gongchengshi1-Dec-08 12:24 
AnswerRe: DataTable.Update throws "duplicate value cannot be inserted into a unique index" Pin
Dave Kreskowiak1-Dec-08 16:52
mveDave Kreskowiak1-Dec-08 16:52 
QuestionUse of WCF with Frameworks 2.0 Pin
papy-boom1-Dec-08 9:00
papy-boom1-Dec-08 9:00 
AnswerRe: Use of WCF with Frameworks 2.0 Pin
Dave Kreskowiak1-Dec-08 16:50
mveDave Kreskowiak1-Dec-08 16:50 
GeneralRe: Use of WCF with Frameworks 2.0 Pin
papy-boom1-Dec-08 20:02
papy-boom1-Dec-08 20:02 
GeneralRe: Use of WCF with Frameworks 2.0 Pin
Simon P Stevens1-Dec-08 22:47
Simon P Stevens1-Dec-08 22:47 
GeneralRe: Use of WCF with Frameworks 2.0 Pin
Dave Kreskowiak2-Dec-08 1:28
mveDave Kreskowiak2-Dec-08 1:28 
Question.net application hangs under vista Pin
zhyluopro1-Dec-08 7:30
zhyluopro1-Dec-08 7:30 
AnswerRe: .net application hangs under vista Pin
Dave Kreskowiak1-Dec-08 7:40
mveDave Kreskowiak1-Dec-08 7:40 

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.