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. how to customize the Form class?

how to customize the Form class?

Scheduled Pinned Locked Moved C#
tutorialquestion
3 Posts 3 Posters 0 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.
  • L Offline
    L Offline
    leeoze 0
    wrote on last edited by
    #1

    Hi, I would like to implemnet a process that will initial on every form on my application on form InitializeComponent... My thought is to some how customize the Form class and inherite the new class as my Form i.e. "public class Form1 : MyCustomizedForm" But I don't wont to recreate to whole Form class, I only whant to implement a process on it's loading after all controls were added. But I need it to take place in every form on my application. Any ideas? tnx

    P N 2 Replies Last reply
    0
    • L leeoze 0

      Hi, I would like to implemnet a process that will initial on every form on my application on form InitializeComponent... My thought is to some how customize the Form class and inherite the new class as my Form i.e. "public class Form1 : MyCustomizedForm" But I don't wont to recreate to whole Form class, I only whant to implement a process on it's loading after all controls were added. But I need it to take place in every form on my application. Any ideas? tnx

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      So, all you want to do is have something like this:

      public class MyCustomizedForm : Form
      {
      public MyCustomizedForm() : base()
      {
      // Do some process here. InitializeComponent will already have
      // been called by the base constructor.
      }
      }

      I'm not a stalker, I just know things. Oh by the way, you're out of milk.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      1 Reply Last reply
      0
      • L leeoze 0

        Hi, I would like to implemnet a process that will initial on every form on my application on form InitializeComponent... My thought is to some how customize the Form class and inherite the new class as my Form i.e. "public class Form1 : MyCustomizedForm" But I don't wont to recreate to whole Form class, I only whant to implement a process on it's loading after all controls were added. But I need it to take place in every form on my application. Any ideas? tnx

        N Offline
        N Offline
        nlarson11
        wrote on last edited by
        #3

        I think your talking about creating a class that inherits from system.windows.forms.form. Then in each of your form's designer's change the inheriting from system.windows.forms.form to this new class. Put code in the new class and each form gets that code? if not -> need clarification with what your trying to do.

        'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous

        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