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. c# Events Redirection in Designer.cs and Visual Studio 2017 More Problems.

c# Events Redirection in Designer.cs and Visual Studio 2017 More Problems.

Scheduled Pinned Locked Moved C#
csharphelpvisual-studiodesignannouncement
5 Posts 4 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.
  • 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. On the other hand, in Visual Studio 2017 I have seen enough things to improve. I am surprised that in Microsoft work so many people and they are all so ready and yet so many defects are easily visible. One problem is that if you modify something in one class and switch to another class, it takes a long time to notice the changes. It is a problem, because you can see a red line of error for quite some time and you are left wondering what the problem is and suddenly it is solved because it has detected the change. I can find dozens of suggestions to make easily but the years pass and from one version to another things do not improve.

    L B P 4 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. On the other hand, in Visual Studio 2017 I have seen enough things to improve. I am surprised that in Microsoft work so many people and they are all so ready and yet so many defects are easily visible. One problem is that if you modify something in one class and switch to another class, it takes a long time to notice the changes. It is a problem, because you can see a red line of error for quite some time and you are left wondering what the problem is and suddenly it is solved because it has detected the change. I can find dozens of suggestions to make easily but the years pass and from one version to another things do not improve.

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

      Then you should send your complaint to Microsoft.

      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. On the other hand, in Visual Studio 2017 I have seen enough things to improve. I am surprised that in Microsoft work so many people and they are all so ready and yet so many defects are easily visible. One problem is that if you modify something in one class and switch to another class, it takes a long time to notice the changes. It is a problem, because you can see a red line of error for quite some time and you are left wondering what the problem is and suddenly it is solved because it has detected the change. I can find dozens of suggestions to make easily but the years pass and from one version to another things do not improve.

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

        A lame computer produces a lame Visual Studio experience.

        "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

        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. On the other hand, in Visual Studio 2017 I have seen enough things to improve. I am surprised that in Microsoft work so many people and they are all so ready and yet so many defects are easily visible. One problem is that if you modify something in one class and switch to another class, it takes a long time to notice the changes. It is a problem, because you can see a red line of error for quite some time and you are left wondering what the problem is and suddenly it is solved because it has detected the change. I can find dozens of suggestions to make easily but the years pass and from one version to another things do not improve.

          B Offline
          B Offline
          BillWoodruff
          wrote on last edited by
          #4

          I think you do have a valid technical question here, but you need to state what it is more clearly; going on about the speed of VS is not going to get you to a solution. A way I handle event triggers across Forms is something like this: 1. Define an Action public field in the Form you want to raise an Event, but have the Event handled in another Form:

          // 'FormWithBtn ... in the Form with the Button
          public ActionBtnAction = null;1.a. define the Button's Click EventHandler, and modify it to invoke the BtnAction:

          private void SomeButton_Click(object sender, EventArgs e)
          {
          if(BtnAction != null) BtnAction(sender as Button);
          }

          2. in the Form that creates the instance of 'FormWithBtn ... for example, the Main Form

          private FormWithButton FWBInstance = new FormWithButton();

          private void Form1_Load(object sender, EventArgs e)
          {
          FWBInstance.BtnAction = FWBButtonHandler;
          }

          private void FWBButtonHandler(Button btn)
          {
          // do whatever
          }

          This "model" of creating Event handling across Forms uses "injection" of an Action (a form of delegate), and it avoids dependency creation between the two contexts (Forms) ... imho, a good thing. Hope this helps.

          «When I consider my brief span of life, swallowed up in an eternity before and after, the little space I fill, and even can see, engulfed in the infinite immensity of spaces of which I am ignorant, and which know me not, I am frightened, and am astonished at being here rather than there; for there is no reason why here rather than there, now rather than then.» Blaise Pascal

          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. On the other hand, in Visual Studio 2017 I have seen enough things to improve. I am surprised that in Microsoft work so many people and they are all so ready and yet so many defects are easily visible. One problem is that if you modify something in one class and switch to another class, it takes a long time to notice the changes. It is a problem, because you can see a red line of error for quite some time and you are left wondering what the problem is and suddenly it is solved because it has detected the change. I can find dozens of suggestions to make easily but the years pass and from one version to another things do not improve.

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

            Regequion wrote:

            One problem is that if you modify something in one class and switch to another class, it takes a long time to notice the changes. It is a problem, because you can see a red line of error for quite some time and you are left wondering what the problem is and suddenly it is solved because it has detected the change. I can find dozens of suggestions to make easily but the years pass and from one version to another things do not improve.

            This is because there is a compilation process silently running in the background to see if the changes you are making are correct (this has been the way for a long time now); meaning that you need to wait for the compile cycle to start and complete before you can be 100% certain that things are okay.

            This space for rent

            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