Search code examples
c#winformsdesigner

Equivalent to Qt Designer's "Change objectName..." for C#/WinForms


In Qt Designer, I can rename a variable from Designer by right-clicking on it and choosing Context Menu->Change objectName...

enter image description here

I want to change the default names such as dataGridView1, dataGridView2, etc. that C# assigns to new controls, but I couldn't find an equivalent property in the Properties box:

enter image description here

I looked for "Object Name", "Name" or something similar. How do I change it?


Solution

  • You can rename a control from Properties window. To do so, select the control and press F4 or right click and choose Properties. Then from toolbar of Properties window, select Properties button with wrench over paper icon. Then change (Name) property.

    enter image description here

    Also you can rename a control using Document Outline window. To to so, press Ctrl + Alt+ T to open Document Outline window. From the control tree select the control which you want and then press F2 or right click and choose Rename.

    enter image description here