r/visualbasic • • Mar 21 '23

VS Driving me crazo

Hello everyone,

Im running "Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.5.1"

and written a new program that reads from a data table and populates a datagridview.

​

nothing special, there are some controls that allow the user to query the table, to get results they need.. again nothing special.

but everytime I change something, I think edit the form layout, the links to the controls are removed.

​

so, on form load, I have it execute some setting up, of the form, and load the data,

​

and on the button, you click it runs the query,

​

the links to the sub routines are removed from the editor, I do not understand why,

can anyone else tell me whats going on?

​

Before Running program

​

​

​

After running program....
3 Upvotes

11 comments sorted by

5

u/JTarsier Mar 21 '23

This bug was fixed in VS 17.5.3 released today. Visual Studio 2022 Release Notes | Microsoft Learn

4

u/KaiProton Mar 24 '23

its been a couple of days, and Im happy to say, that update fixed my issues..

3

u/KaiProton Mar 21 '23

No Way!

I'll update tomorrow..

1

u/KaiProton Mar 22 '23

Running the Update on VS this morning seems to have fixed the issue,

​

I opened the project, had no 'handles' defined,

so I added them all manually, and save/run the project.

​

then went back adjusted the form,

save and run,

all worked,

went back and all the handles were there still

yay

1

u/snang Moderator Mar 21 '23

Is your handler defined properly on the Load event or are you manually creating a Form1_Load method?

1

u/KaiProton Mar 21 '23

To be honest, I usually let VS figure that out,

and Double click the dropdown, and it defines it for me,

in this case:

Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

​

Im only adding them back manually now, as its losing it each time

1

u/snang Moderator Mar 21 '23

That's definitely not normal behavior.

Might try doing a clean and rebuild on the project. You could also create a new form and see if the problem persists.

1

u/KaiProton Mar 21 '23

Is clean and rebuild something in the tools menu?

My history is really VBA, and never dipped very far into Vb.net

also I like the idea of another form so I will build another form into the project, and see,

1

u/snang Moderator Mar 21 '23

Should be under the Build menu.

Build -> Clean Solution

Build -> Rebuild Solution

1

u/KaiProton Mar 21 '23

Thank for that,

I googled it too, and just did it,

and all my code links disappeared again lol

I will try a new form in a little while and see what happens

1

u/veryabnormal Mar 22 '23

Oh. I’ve seeen this numerous times. The handles fall off. You move 1 control in the designer and every handles statement vanishes for all controls. I usually restore the code file from overnight backup, or go through the file searching for eventargs and put them back in. Nice to hear they’ve fixed it.