VB.Net 2019 after latest update my project saved as .dll does not recognize any shared item

Simon 466 Reputation points
2022-01-27T14:50:46.923+00:00

VB.Net 2019 after latest update my project saved as .dll does not recognize any shared item

Developer technologies | Visual Studio | Debugging
{count} votes

Accepted answer
  1. Michael Taylor 60,331 Reputation points
    2022-01-27T15:32:55.553+00:00

    The latest update shouldn't have broken language behavior. I suspect there might be something else going on or perhaps your code was never really correct to begin with. Please post the code that is failing along with any relevant information so we can help figure this out.

    As for using fields from the main form it is generally not recommended that you use shared fields as that isn't a good UI design. However it really depends upon what you're trying to do so without more information it would be hard to provide good suggestions. At a high level, data needed by child forms should be set on properties exposed by the child form. The main form sets the properties before showing the child form. Look at the SelectedFilename property of OpenFileDialog for an example of how this might work.

    If you need to share data across forms and that data is changing over time then the UI doesn't actually own the data and therefore shouldn't contain it. Move the data out of the form and have the forms update themselves based upon the data and listen for data change events. This is what the INotifyPropertyChanged interface is designed for but there are other approaches as well depending upon the type of app you're building.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Simon 466 Reputation points
    2022-01-27T17:38:15.297+00:00

    I really appreciate your response with such clarity.
    I wanted to ask you another thing, I have a Main Form that contains a child form
    and from the child form I want to manage the main form to save the data and move it to the next record.
    Is this possible to do?


  2. Simon 466 Reputation points
    2022-01-27T18:48:42.953+00:00

    i am working on vb.net not c
    if you can explain in vb.net
    thanks in advence


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.