Thread: Desing and Coding

  1. #1
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    Desing and Coding

    Well i just started to learn C#.. When i started a C# Window application project.. I could see the design window and the code windows( similar to VB).. but when i code on my own... without using the design mode if i code say buttons, text box etc they are not reflected in the design window.. And when i put buttons, boxes etc in the design windows.. i dont see any code in the code window which indicates the creation of the button or components... But the component event code are displayed when i double click the components in the design window...


    So does this mean that if i want to develop an application i have to entirely do it using any one of the methods for the designing of the form...

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    I am also kinda new but I am pretty sure that the code have to be within "private void InitializeComponent()" for the designer to see it. Also beware that the designer change code as it see fit in the InitializeComponent().

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Everything you do in the designer is reflected in InitializeComponent(). Everything you change in InitializeComponent is reflected in the designer. However, you should only use one method, not mix both, because the designer can change anything you wrote in InitializeComponent as it sees fit. If you need initialization by hand for whatever reason, use the constructor right after the call to InitializeComponent.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Usign the designer puts its own crappy codes there.. Well but coding everythin(GUI) by code is kida time consuming..

    Which method would you prefer to do it..

  5. #5
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Use the designer, thats what it's there for. There's no need to do anything yourself
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  6. #6
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    Originally posted by vasanth
    Usign the designer puts its own crappy codes there.
    Example?

Popular pages Recent additions subscribe to a feed