Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VB -> C#: Form_Load Event not triggered in converted code #550

Closed
marcal opened this issue Mar 23, 2020 · 6 comments
Closed

VB -> C#: Form_Load Event not triggered in converted code #550

marcal opened this issue Mar 23, 2020 · 6 comments
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@marcal
Copy link

marcal commented Mar 23, 2020

Hello,

I have seen another problem while testing conversion of small projects. Here is a zip file to reproduce.
testhandler.zip

I use the last version 8.0.2.0 I have seen that a Form_Load event doesn't trigger in the converted code.
The project opens a Form1 dialog and when I click on the button, the HfrmDB opens but there is no handler in the form_Load Event so the combo box is not filled.

EDIT : It seems to be the Load and Shown events that have the problem (perhaps there are others)
Marc

@marcal marcal added the VB -> C# Specific to VB -> C# conversion label Mar 23, 2020
@GrahamTheCoder
Copy link
Member

One of the issues here was that while usually VB puts event handlers in the constructor (creating one if needed), for DesignerGenerated classes, it puts them inside InitializeComponent.

There may still be other cases where handlers get missed since the code to cover these cases is getting a little messy. Next time an issue here pops up it could do with some tidying.

@marcal
Copy link
Author

marcal commented Mar 24, 2020

Hello,

Thank you.
Sometimes I create a non visible class that triggers Events so I guess I will have the problem.

@GrahamTheCoder
Copy link
Member

Sorry I didn't quite understand

@marcal
Copy link
Author

marcal commented Mar 24, 2020

Hello,

I have a converter class . This class will convert some user datas. This class defines a public event and when I need to convert datas, if the datas has not been converted before, I trigger an event with the needed information and one parameter byref. The GUI will receive the event and ask for the user to select what value is needed.) I will make a test in that project and see if all is fine (I make tests with some old projects I have).

Thank you again
Marc

@Saibamen
Copy link
Contributor

Please retest with recent version

@marcal
Copy link
Author

marcal commented Mar 31, 2020

Hello,
It is still working fine with 8.0.4.0

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

3 participants