Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Newbie code problem please help?

Newbie code problem please help?

Scheduled Pinned Locked Moved C#
helpcsharpquestion
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wolf92
    wrote on last edited by
    #1

    Hi, I am writing a program in C#, and I want a customize form to pop up. I created the new form and set it up as a new item (Form frmCustomize = new Form();). So then, in my code, I put this code in for when they click on Customize, and the form shows, but none of the controls are there, any reasons why, or any help? The code: // When they click 'Customize' from the help menu the Customize form shows private void customizeToolStripMenuItem_Cli... sender, EventArgs e) { // Show the customize form frmCustomize.Show(); }

    C R 2 Replies Last reply
    0
    • W Wolf92

      Hi, I am writing a program in C#, and I want a customize form to pop up. I created the new form and set it up as a new item (Form frmCustomize = new Form();). So then, in my code, I put this code in for when they click on Customize, and the form shows, but none of the controls are there, any reasons why, or any help? The code: // When they click 'Customize' from the help menu the Customize form shows private void customizeToolStripMenuItem_Cli... sender, EventArgs e) { // Show the customize form frmCustomize.Show(); }

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Wolf92 wrote:

      Form frmCustomize = new Form()

      This creates an instance of the base class Form, not the form you created. You have to do something like this:

      private Form customiseForm = new CustomiseForm();

      Note: I've assumed your customise form class is called CustomiseForm. I've also assumed that you expose no new public functionality. If you do (and it most likely is that you do) then you may wish to declare the customiseForm field as a CustomiseForm rather than a simple Form. Does this help?


      Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos

      1 Reply Last reply
      0
      • W Wolf92

        Hi, I am writing a program in C#, and I want a customize form to pop up. I created the new form and set it up as a new item (Form frmCustomize = new Form();). So then, in my code, I put this code in for when they click on Customize, and the form shows, but none of the controls are there, any reasons why, or any help? The code: // When they click 'Customize' from the help menu the Customize form shows private void customizeToolStripMenuItem_Cli... sender, EventArgs e) { // Show the customize form frmCustomize.Show(); }

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        Wolf92 wrote:

        Form frmCustomize = new Form()

        That creates an empty form, which is what you're seeing. You probably meant to do:

        Form frmCustomize = new CustomizeForm();

        /ravi

        This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups