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. Visual Studio
  4. Designer Events to a Class

Designer Events to a Class

Scheduled Pinned Locked Moved Visual Studio
designhelp
3 Posts 3 Posters 2 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.
  • Z Offline
    Z Offline
    zequion
    wrote on last edited by
    #1

    I need to make the buttons events of the form designer (form1.designer.cs) be activated in a different class other than form1.cs. I do this to have a class that activates standard form buttons for different programs and does not have to repeat code. For this, For the event to be activated in the Cls_StandardEventos class, i have introduced lines as: This._Main_Nv2MedioDerSuperTabControl.TabMoved + = new System.EventHandler (Name_StandardEventos.Cls_StandardEventos.Fcn_Tab_Nv2MedioDerSuperTabControl_TabMoved); form1.designer.cs does not display red error line but I can not see the design view of the form because it shows the error that does not find Name_StandardEventos.Cls_StandardEventos in the assembly.

    L Richard DeemingR 2 Replies Last reply
    0
    • Z zequion

      I need to make the buttons events of the form designer (form1.designer.cs) be activated in a different class other than form1.cs. I do this to have a class that activates standard form buttons for different programs and does not have to repeat code. For this, For the event to be activated in the Cls_StandardEventos class, i have introduced lines as: This._Main_Nv2MedioDerSuperTabControl.TabMoved + = new System.EventHandler (Name_StandardEventos.Cls_StandardEventos.Fcn_Tab_Nv2MedioDerSuperTabControl_TabMoved); form1.designer.cs does not display red error line but I can not see the design view of the form because it shows the error that does not find Name_StandardEventos.Cls_StandardEventos in the assembly.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You need to add your code manually in the main code, not in the form designer.

      1 Reply Last reply
      0
      • Z zequion

        I need to make the buttons events of the form designer (form1.designer.cs) be activated in a different class other than form1.cs. I do this to have a class that activates standard form buttons for different programs and does not have to repeat code. For this, For the event to be activated in the Cls_StandardEventos class, i have introduced lines as: This._Main_Nv2MedioDerSuperTabControl.TabMoved + = new System.EventHandler (Name_StandardEventos.Cls_StandardEventos.Fcn_Tab_Nv2MedioDerSuperTabControl_TabMoved); form1.designer.cs does not display red error line but I can not see the design view of the form because it shows the error that does not find Name_StandardEventos.Cls_StandardEventos in the assembly.

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        You have already posted this in the C# forum: c# Events Redirection in Designer.cs and Visual Studio 2017 More Problems. - C# Discussion Boards[^]


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        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