SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

my question again! please help! in need a migrate

Last post 04-25-2017 3:22 PM by bfharreguy. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 04-22-2017 12:58 AM

    my question again! please help! in need a migrate

    i have my cuestion here:

    http://stackoverflow.com/questions/43552759/import-project-from-sharpdevelop-4-4-to-visual-studio-2010

    and here http://community.sharpdevelop.net/forums/t/25202.aspx

    Please help!! i need a solution please! thanks!!

  • 04-22-2017 1:31 PM In reply to

    Re: my question again! please help! in need a migrate

    From your previous message, i understand you have a little test project in SharpDevelop.

    Sent it to me, and i will try to see what is wrong with it.

    mail this to   (remove spaces)    luc wuyts 02 @ gmail . com

     

     

  • 04-22-2017 2:30 PM In reply to

    Re: my question again! please help! in need a migrate

    This is the bouth projects

    http://www.mediafire.com/file/5pjr990cdsny5o8/projects.zip

    The problema is when i save in visual studio 2010, visual studio do a change in the code, you can see it here for example

    change This:

    Sub Button1Click(sender As Object, e As EventArgs
    For This:
    Sub Button1Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click

    The visual studio add handles for all subs from all form in the project, and the error is "handler" becouse don't need it, what can i do to save project in visual studio and it cannnot change the code, like thhis, please help

  • 04-22-2017 2:46 PM In reply to

    Re: my question again! please help! in need a migrate

    I looked at your project (the sharpdevelop example)

    In the MainForm.Designer.vb (at the bottom) you see this

        Private button1 As System.Windows.Forms.Button

        Friend WithEvents Button2 As System.Windows.Forms.Button

     

    Just put WithEvents between   "Private" and "button1" so it becomes this:

    Private WithEvents button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    
    
    Also see here:
    https://msdn.microsoft.com/en-us/library/32787dt6.aspx

    Hope this helps

    
    
    
    										    
    									    
  • 04-22-2017 4:00 PM In reply to

    Re: my question again! please help! in need a migrate

    Thanks for your response! i think, you dont understand me, This problem i have is a example, my project is has a very large, i have 300 subs, I mean, I open my project into Visual Studio 2010,  previously created in Sharpdevelop 4,4, When I make some change, any change, and save them, the visual studio change all subs!! and i have the error "Handler" for each sub i have in the form saved. I need some fix simple, to solve this multiple errors! do you understand me? THANKS FOR YOUR TIME!

  • 04-22-2017 4:00 PM In reply to

    Re: my question again! please help! in need a migrate

    Thanks for your response! i think, you dont understand me, This problem i have is a example, my project is has a very large, i have 300 subs, I mean, I open my project into Visual Studio 2010,  previously created in Sharpdevelop 4,4, When I make some change, any change, and save them, the visual studio change all subs!! and i have the error "Handler" for each sub i have in the form saved. I need some fix simple, to solve this multiple errors! do you understand me? THANKS FOR YOUR TIME!

  • 04-22-2017 7:50 PM In reply to

    Re: my question again! please help! in need a migrate

    Why not write a little script or prog, just to correct every line in your project?

    Read a line, look if this line will have the problem, correct it and save it.

    Or you can start from the error-list in VS.  There you have a list with every line with this problem.  Linenumber included i think.

    (I have used VS2017 with your example project)

    If VS expects this, i think it is wise to correct this.

  • 04-25-2017 12:10 AM In reply to

    Re: my question again! please help! in need a migrate

    i think!! i try all!! and i cannot fix!! i need i script or something, i have very long error, and i don't know how to fix it! in simple words, what is the fix?

  • 04-25-2017 2:01 AM In reply to

    Re: my question again! please help! in need a migrate

    Because you seem to struggle a long time with this, i decided to install #develop and test it myself.

     

    It is a very long time since i worked with #develop, and i never have used vb.net

    First i try to see what is the difference between #develop vb.net and  VS vb.net 

     

    When you add a button in a vb.net project in #develop, this button is created as follows:

     

    In the designer generated file:

    The button:

    Private button1 As System.Windows.Forms.Button

    The event handler:

    AddHandler Me.button1.Click, AddressOf Me.Button1Click

    In your class for the form:

    Sub Button1Click(sender As Object, e As EventArgs)

    End Sub

    In Visual Studio, when you create the same form, this is different:

    In the designer generated file:

    Friend WithEvents Button1 As Button

    !! there is NO code for the event handler in this file.

    In your class for the form:

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    End Sub

    When you change your project in VS, VS will change the existing event handlers, and this is the origin of your problem.

    In my little test, VS removed the line 

    AddHandler Me.button1.Click, AddressOf Me.Button1Click

     

    The only change you have to do is add WithEvents in the definition of the button.

    PS: It seems this is a problem for all designer generated events.

    How to correct this problem:

    I suggest you use your original #develop source (without VS modifications)

    I also suppose you have named all your components with the same starting word or letters:

    eg: Button -> button1, button2   or   btn1, btn2

    Label -> label1, label2 ....

    Install Notepad++

    Open this, open 1 of your source files 

    From the menu:  Search In Files

    you search for: private button  

    replace with: private WithEvents button

    Filters: *.Designer.vb

    And click the button "Search Files"

     

    Do the same for the other components like  "private label" or whatever.

     

    I have compiled this change with #develop, and this compiles and runs as expected with this little change.

     

    Make a copy of your project, and open the solution file with Visual Studio  (i did not use a special converter)

     

    I hope this will solve your problem forever!

  • 04-25-2017 3:18 AM In reply to

    Re: my question again! please help! in need a migrate

    Oh and if you have subfolders in your project, make sure you select the search and replace checkbox to search in subfolders too.

     

  • 04-25-2017 3:22 PM In reply to

    Re: my question again! please help! in need a migrate

    VERY THANKS !!! for your time!! this is important for me!! THANKS

Page 1 of 1 (11 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.