Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I change the default modifier from Friend to Private in the Windows Forms designer in VS 2008?

When I develop a Windows Forms app in Visual Studio using C#, every control that I add to my form is by default marked as private, which is what I want.

When using VB.NET, every control is by default marked as Friend (the equivalent of internal in C#), which is not what I want.

Can I just change this default? It seems like surely it's a setting somewhere.

like image 601
Dan Tao Avatar asked Jul 02 '10 19:07

Dan Tao


People also ask

What is the name of the windows which you can We can manipulate the form VB design?

VB.Net programmers have made extensive use of forms to build user interfaces. Each time you create a Windows application, Visual Studio will display a default blank form, onto which you can drag and drop controls from the Visual Studio Toolbox window.

Which window is used to design a form?

The easiest way to design a form is to use the Windows Forms Designer in Visual Studio . NET.

What is Form Designer in Visual Basic?

Windows Forms Designer in Visual Studio provides a rapid development solution for creating Windows Forms-based applications. Windows Forms Designer lets you easily add controls to a form, arrange them, and write code for their events.


2 Answers

Annoying, isn't it.

What I usually do is when the form is stable, I replace Friend WithEvents to Private then add WithEvents to the controls that have Handles clauses.

Yes, you would think there was a setting, but I never found it.

like image 171
AMissico Avatar answered Oct 19 '22 23:10

AMissico


This was suggested to Microsoft, but they chose not to fix it.

[Sorry, posting this as an answer because I don't have enough points to add comments.]

like image 41
Dileep A Avatar answered Oct 19 '22 23:10

Dileep A