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

Join 136,836 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,707 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
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
+Quote Post

gabehabe
RE: So, I Think It Creates A Panel But Doesn't Show Up.
3 Oct, 2008 - 03:00 AM
Post #2

Donkey DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 5,551



Thanked: 98 times
Dream Kudos: 2650
Expert In: ruling the world.

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
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 04:05PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month