设置对象的默认前缀 [英] Setting Default Prefixes for Objects

查看:75
本文介绍了设置对象的默认前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在从数据源或工具箱中添加任何控件或对象以形成表单后,vb将对象类型名称后缀到该控件,例如对于名称"字段NameTextBox,对于数据适配器"之类的组件,请说AddresesDataAdapter,AddresesBindingSource等.

在这里我想问你是否可以更改此默认方式来标识对象,即可以为不同的对象设置所需的前缀.

对于文本框控件说txt前缀,对于标签控件说lbl,对于组合框说cbo,对于表适配器来说ta,对于绑定源&来说是bs.很快.谢谢.

After adding any control or object to form from datasource or toolbox, vb postfixes object type name to that control e.g. for Name field NameTextBox, for Component like Data Adapter say AddresesDataAdapter, AddresesBindingSource and so on.

Here i want to ask you that may i change this default way to identify the object i.e. may i set prefixes desired for diffrent objects.

Say txt prefix for textbox control, lbl for label control, cbo for Combo Box,ta for Table Adapter, bs for Binding Source & so on. Thanks.

推荐答案

liliane10写道:
liliane10 wrote:

在将任何控件或对象添加到表单后从数据源或工具箱中,vb将对象类型名称后缀到该控件,例如对于名称"字段NameTextBox,对于数据适配器"之类的组件,请说AddresesDataAdapter,AddresesBindingSource等.

After adding any control or object to form from datasource or toolbox, vb postfixes object type name to that control e.g. for Name field NameTextBox, for Component like Data Adapter say AddresesDataAdapter, AddresesBindingSource and so on.



我不认为这是真的.如果默认情况下在VB.NET中从工具箱中拖动文本框,名称将是TextBox1,在C#中它将是textBox1 ,. NET怎么会知道您要使用此文本框作为名称" ?这需要更改.



I don''t think this is true. If you drag a text box from tool box by default in VB.NET the name will be TextBox1 and in C# it will be textBox1, how come the .NET know that you want to use this text box for Name? This you need to change.

liliane10写道:
liliane10 wrote:

在此,我想问一下我是否可以更改此默认方式来标识对象,即可以为不同的对象设置所需的前缀.

对于文本框控件说txt前缀,对于标签控件说lbl,对于组合框说cbo,对于表适配器来说是ta,对于绑定源&来说是bs.很快.谢谢.

Here i want to ask you that may i change this default way to identify the object i.e. may i set prefixes desired for diffrent objects.

Say txt prefix for textbox control, lbl for label control, cbo for Combo Box,ta for Table Adapter, bs for Binding Source & so on. Thanks.




这完全取决于您的偏好和选择.如果您正在使用现有的应用程序,则请遵循现有的命名约定;如果要启动新的应用程序,请根据您的选择使用.但是我会建议您是否正在使用.NET进行项目开发,然后按照Microsoft的命名约定准则进行操作.

http://msdn.microsoft.com/en-us/library/0b283bse(VS .71).aspx [ ^ ]




This is entirely depends on you preference and choice. If you are working on an existing application then follow the existing naming convention and if you are starting a new application then use as per your choice. But I will suggest if your are working on a project using .NET then follow Microsoft guidelines for the naming convention.

http://msdn.microsoft.com/en-us/library/0b283bse(VS.71).aspx[^]


这篇关于设置对象的默认前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆