Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 132,301 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,012 people online right now. Registration is fast and FREE... Join Now!




So, I think it creates a Panel but doesn't show up.

 
Reply to this topicStart new topic

So, I think it creates a Panel but doesn't show up., The panel doesn't show up - so did I so eomthign wrong?

EvolutionMedia
post 3 Oct, 2008 - 12:59 AM
Post #1


D.I.C Head

**
Joined: 11 Aug, 2008
Posts: 83



Thanked 1 times
My Contributions


Hey guys,

okay, some good things went well when i compiled the program however,

the button that is suppost to put the function CreateNewPhase(this); seem not to work - like nothing happens. I don't know if I'm doing it right or not.

Also, another thing is that I can't seem to add anumber like "Panel" & step;

It says that the & operator can't be added to a string or int.

So here's the code sample: Now the point of this whole thing is to create new panels when the user presses the next button. Also the pannel that is created is inside a split container. So, i don't know if that has to do with anything.

Here's the code section within a empty code file.

CODE

private static int step = 0;


    

    public static void CreateNewPhase(System.Windows.Forms.Form frm)
    {

        step += 1;



        System.Windows.Forms.Panel NewPanel = new System.Windows.Forms.Panel();


        
        NewPanel.Name = "Panel" step;
        


        frm.Controls.Add(NewPanel);



    }


Also, here's the snap shot so you guys have a better idea.

Thanks for help!

Sincerely,

Paul

P.S. Should I go back to VB.NET or just stick with C#?


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 3 Oct, 2008 - 03:00 AM
Post #2


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


Your problem lies here:
NewPanel.Name = "Panel" step;

It should be:
NewPanel.Name = "Panel" + step;

Hope this helps smile.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 01:46AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month