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. Convert code .Net4.0 to code .Net 2.0

Convert code .Net4.0 to code .Net 2.0

Scheduled Pinned Locked Moved C#
csharphelp
22 Posts 8 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.
  • U User 2456424

    I have the following code C# 2008 want to switch to the C#2005 Net2.0 after his move has been an error, thanks to the help available tracks. [CODE] //C# 2008 namespace Example1 { public partial class Form1 : Form { Control draggingControl = new Control{ BackColor = Color.Green, Visible = false }; // warning error here public Form1() { InitializeComponent(); // ... } // ... } } [/CODE] [CODE] //C# 2005 //... Control draggingControl = new Control(); draggingControl.BackColor = Color.Green; // warning error here draggingControl.Visible = false; // warning error here //... [/CODE]

    D Offline
    D Offline
    DanielBrownAU
    wrote on last edited by
    #2

    is it showing warnings or errors? Any chance of getting to see the error?

    1 Reply Last reply
    0
    • U User 2456424

      I have the following code C# 2008 want to switch to the C#2005 Net2.0 after his move has been an error, thanks to the help available tracks. [CODE] //C# 2008 namespace Example1 { public partial class Form1 : Form { Control draggingControl = new Control{ BackColor = Color.Green, Visible = false }; // warning error here public Form1() { InitializeComponent(); // ... } // ... } } [/CODE] [CODE] //C# 2005 //... Control draggingControl = new Control(); draggingControl.BackColor = Color.Green; // warning error here draggingControl.Visible = false; // warning error here //... [/CODE]

      S Offline
      S Offline
      Simon_Whale
      wrote on last edited by
      #3

      quick question but what is Control?

      Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

      U 1 Reply Last reply
      0
      • S Simon_Whale

        quick question but what is Control?

        Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

        U Offline
        U Offline
        User 2456424
        wrote on last edited by
        #4

        it is in this article you http://stackoverflow.com/questions/28878310/custom-paint-splitter-control-in-c-sharp-winforms I'm copy them, but it's not run, want to converter to C#2005 (.Net 2.0)

        D L 2 Replies Last reply
        0
        • U User 2456424

          it is in this article you http://stackoverflow.com/questions/28878310/custom-paint-splitter-control-in-c-sharp-winforms I'm copy them, but it's not run, want to converter to C#2005 (.Net 2.0)

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #5

          You have to rewrite the code. The code that's throwing these errors is using features of C# that were not around in 2005. In your examples, it's using a shortcut to setting properties after creating an instance of Control. You just have to break those lines inside the curly braces out into their own lines of code.

          A guide to posting questions on CodeProject

          Click this: Asking questions is a skill. Seriously, do it.
          Dave Kreskowiak

          U 1 Reply Last reply
          0
          • D Dave Kreskowiak

            You have to rewrite the code. The code that's throwing these errors is using features of C# that were not around in 2005. In your examples, it's using a shortcut to setting properties after creating an instance of Control. You just have to break those lines inside the curly braces out into their own lines of code.

            A guide to posting questions on CodeProject

            Click this: Asking questions is a skill. Seriously, do it.
            Dave Kreskowiak

            U Offline
            U Offline
            User 2456424
            wrote on last edited by
            #6

            follow you fix solutions how not ? I'm secrets can you help me ?

            D 1 Reply Last reply
            0
            • U User 2456424

              follow you fix solutions how not ? I'm secrets can you help me ?

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #7

              Uhhh...Yoda just read that and went "What?" If you're asking me to rewrite the code for you,that's not going to happen. I've got my own code to write and I've got a few hours work left before I can go to sleep tonight.

              A guide to posting questions on CodeProject

              Click this: Asking questions is a skill. Seriously, do it.
              Dave Kreskowiak

              U 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Uhhh...Yoda just read that and went "What?" If you're asking me to rewrite the code for you,that's not going to happen. I've got my own code to write and I've got a few hours work left before I can go to sleep tonight.

                A guide to posting questions on CodeProject

                Click this: Asking questions is a skill. Seriously, do it.
                Dave Kreskowiak

                U Offline
                U Offline
                User 2456424
                wrote on last edited by
                #8

                no need to rewrite the code, the original was this error No overload for 'splitter1_SplitterMoving' matches delegate 'System.Windows.Forms.SplitterCancelEventHandler' you fix this ?

                D P 2 Replies Last reply
                0
                • U User 2456424

                  no need to rewrite the code, the original was this error No overload for 'splitter1_SplitterMoving' matches delegate 'System.Windows.Forms.SplitterCancelEventHandler' you fix this ?

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #9

                  No, I can't. You typed the code and I can't see it. The error is telling you that you've got the method header parameter list for "splitter1_SplitterMoving" wrong.

                  A guide to posting questions on CodeProject

                  Click this: Asking questions is a skill. Seriously, do it.
                  Dave Kreskowiak

                  1 Reply Last reply
                  0
                  • U User 2456424

                    it is in this article you http://stackoverflow.com/questions/28878310/custom-paint-splitter-control-in-c-sharp-winforms I'm copy them, but it's not run, want to converter to C#2005 (.Net 2.0)

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

                    Why not go and ask the person who wrote the article?

                    1 Reply Last reply
                    0
                    • U User 2456424

                      no need to rewrite the code, the original was this error No overload for 'splitter1_SplitterMoving' matches delegate 'System.Windows.Forms.SplitterCancelEventHandler' you fix this ?

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

                      Look, an example of the SplitterMoving event[^]. Take a look at the event handler there and compare it to yours.

                      This space for rent

                      U 1 Reply Last reply
                      0
                      • U User 2456424

                        I have the following code C# 2008 want to switch to the C#2005 Net2.0 after his move has been an error, thanks to the help available tracks. [CODE] //C# 2008 namespace Example1 { public partial class Form1 : Form { Control draggingControl = new Control{ BackColor = Color.Green, Visible = false }; // warning error here public Form1() { InitializeComponent(); // ... } // ... } } [/CODE] [CODE] //C# 2005 //... Control draggingControl = new Control(); draggingControl.BackColor = Color.Green; // warning error here draggingControl.Visible = false; // warning error here //... [/CODE]

                        C Offline
                        C Offline
                        CHill60
                        wrote on last edited by
                        #12

                        The error I got by simply pasting the code into a blank project was

                        Quote:

                        Error 1 The name 'Color' does not exist in the current context

                        That went away when I included

                        using System.Drawing;

                        In a subsequent comment you stated

                        Quote:

                        the original was this error No overload for 'splitter1_SplitterMoving' matches delegate 'System.Windows.Forms.SplitterCancelEventHandler'

                        Nothing in the code you have posted nor in the link you provided produces that error - you will need to show us that code if you expect some help

                        U 1 Reply Last reply
                        0
                        • P Pete OHanlon

                          Look, an example of the SplitterMoving event[^]. Take a look at the event handler there and compare it to yours.

                          This space for rent

                          U Offline
                          U Offline
                          User 2456424
                          wrote on last edited by
                          #13

                          your link posted nearly identical to my questions, your example changes the mouse pointer while dragging splitBar, my questions changes the color tranparen for splitBar while dragging splitBar. Thank you send me the link for referenceing

                          P 1 Reply Last reply
                          0
                          • U User 2456424

                            your link posted nearly identical to my questions, your example changes the mouse pointer while dragging splitBar, my questions changes the color tranparen for splitBar while dragging splitBar. Thank you send me the link for referenceing

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

                            You're welcome.

                            This space for rent

                            P 1 Reply Last reply
                            0
                            • C CHill60

                              The error I got by simply pasting the code into a blank project was

                              Quote:

                              Error 1 The name 'Color' does not exist in the current context

                              That went away when I included

                              using System.Drawing;

                              In a subsequent comment you stated

                              Quote:

                              the original was this error No overload for 'splitter1_SplitterMoving' matches delegate 'System.Windows.Forms.SplitterCancelEventHandler'

                              Nothing in the code you have posted nor in the link you provided produces that error - you will need to show us that code if you expect some help

                              U Offline
                              U Offline
                              User 2456424
                              wrote on last edited by
                              #15

                              I declare libraries needed then but not run. you see my attach file SplitterPaint_[^]

                              C 1 Reply Last reply
                              0
                              • P Pete OHanlon

                                You're welcome.

                                This space for rent

                                P Offline
                                P Offline
                                pmayankcodep
                                wrote on last edited by
                                #16

                                Hi, I have currently migrated my application from 2.0 to 4.0. What i suggest is try to build your code from target framework 4.0 to 2.0, also setting up the cpu type as x86 for 32 bit platform. Also, if there are some client side validation, you need to do settings in pages element attribute controlRenderingCompatibilityVersion=2.0 in web.config for the asp.net controls.

                                -Mayank Pant

                                P 1 Reply Last reply
                                0
                                • P pmayankcodep

                                  Hi, I have currently migrated my application from 2.0 to 4.0. What i suggest is try to build your code from target framework 4.0 to 2.0, also setting up the cpu type as x86 for 32 bit platform. Also, if there are some client side validation, you need to do settings in pages element attribute controlRenderingCompatibilityVersion=2.0 in web.config for the asp.net controls.

                                  -Mayank Pant

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

                                  Don't know why you're telling me this. I know how to convert code. If you meant to tell the OP how to do this, they won't get any notifications that you replied to another person.

                                  This space for rent

                                  P U 2 Replies Last reply
                                  0
                                  • U User 2456424

                                    I declare libraries needed then but not run. you see my attach file SplitterPaint_[^]

                                    C Offline
                                    C Offline
                                    CHill60
                                    wrote on last edited by
                                    #18

                                    I don't download unsolicited files from unknown sources. You can post code here or use something like imgur to show an image.

                                    U 1 Reply Last reply
                                    0
                                    • P Pete OHanlon

                                      Don't know why you're telling me this. I know how to convert code. If you meant to tell the OP how to do this, they won't get any notifications that you replied to another person.

                                      This space for rent

                                      P Offline
                                      P Offline
                                      pmayankcodep
                                      wrote on last edited by
                                      #19

                                      Pete ! my bad. I just replied to your thread. That was not my intentions. Thank you for correcting me .

                                      1 Reply Last reply
                                      0
                                      • P Pete OHanlon

                                        Don't know why you're telling me this. I know how to convert code. If you meant to tell the OP how to do this, they won't get any notifications that you replied to another person.

                                        This space for rent

                                        U Offline
                                        U Offline
                                        User 2456424
                                        wrote on last edited by
                                        #20

                                        Hello friends ! Now, I do not Convert 2.0, I'm using 4.0, but still you see the error of my attachments SplitterPaint_[^]

                                        1 Reply Last reply
                                        0
                                        • C CHill60

                                          I don't download unsolicited files from unknown sources. You can post code here or use something like imgur to show an image.

                                          U Offline
                                          U Offline
                                          User 2456424
                                          wrote on last edited by
                                          #21

                                          I checked and normal download you can tell me why you can not download ?

                                          C 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