Control Names

Hi All:
Is there a way to change the default name that is assigned to a control both when dragging from the toolbox or a datasource

Thanks
Kevin



------------------------------------
There ain't no answer.
There ain't going to be any answer.
There never has been an answer.
That's the answer.
--------------------Gertrude Stein



Answer this question

Control Names

  • abhishekh26

    I probably phrased the question wrong. I know I can change it manually. What I would like to know is  can you set a default style for the control name. For example 'txtTextBox1' instead of TextBox1 or in the case of a bound data control can I change it so that the IDE assigns 'txtLastName'   instead of  'LastNameTextBox1' for a field named LastName


  • hawkpie

    Hi,

    You can change the (Name) property of the control using the Properties tool window.

    Best regards,

  • Mathew Clark

    Hi,

    Sorry for the confusion.

    I can answer for the Data Sources tool window. We don't expose a way to do so. It's pretty hard trying to be smart about naming controls. One thing that is cheap to do (I think) is to name the control "TextBoxLastName" instead of "LastNameTextBox". I think the reason you want "txtLastName" is to be able to see all your text boxes together in Intellisense The quick fix above may help with that.

    To allow detailed settings like you propose is pretty expensive to do. We would have to deal with user-defined controls as well. But can you explain more what do you have in mind for this type of settings Do you want to be able to set the prefix for all types of controls

    For the Windows Form Designer, you can try asking at http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=8&SiteID=1.

    Best regards,

  • Tyler Whitney

    Hi:
    I was really thinking in terms of just setting a prefix for controls.  It is one of those things that would be nice to have but it is far from important.  VS 2005 is making my life so much easier that I'm just getting lazy in my dotage.
    I have to say that despite a bug here and there I am really enjoying using VS 2005, now I'm finally ready to leave VB6 behind.

    Kevin

  • Control Names