在VB.NET中保留文本框中的最后一个值 [英] Retaining Last Value in the Text Boxes in VB.NET

查看:71
本文介绍了在VB.NET中保留文本框中的最后一个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何保留用户在文本中键入的最后一个值

框?当用户第二次运行可执行文件时,我应该能够显示值。


感谢帮助。

Suresh

解决方案

Suresh,


看,没有单一的最佳选项。我可以举一些关于

的例子,哪种方式最适合应用程序的性质:


a)选项桌面应用程序的对话框。通常设置是存储在注册表或配置文件中的
。请参阅

Microsoft.Win32.Registry类和System.Configuration命名空间以获取更多详细信息和示例。


b)A偏好 Web应用程序的Web页面。 Web应用程序最多

经常与某种数据库一起使用,并且通常将所有信息存储在数据库中。有关更多信息和示例,请参阅System.Data命名空间文档




c)桌面CRM应用程序中的客户详细信息。这种复杂的应用程序

通常也依赖于某种数据库或结构化存储。


P.S.事实上,你问的问题是宽带。我建议你

面临一个特定问题,如果你想描述你想要实现的东西,我认为社区可以提出更详细的建议。 />

-

Dmitriy Lapshin [C#/ .NET MVP]

X-Unity测试工作室
http://x-unity.miik.com.ua/teststudio.aspx

将单元测试的强大功能带到VS .NET IDE


" Suresh Kumaran" <ク******** @ hotmail.com>在留言中写道

news:0e **************************** @ phx.gbl ... < blockquote class =post_quotes> Dmitriy,

这样做的最佳选择是什么?你有这个样本编码吗?

提前致谢,

Suresh




Dmitriy,


感谢您的回复。


好​​吧,这就是我想要的。我的应用程序是使用VB.NET开发的
设计是这样的。


A.表单1旨在让用户输入部件号。表单

1有两个按钮Okay和取消如果用户

点击Okay,则会验证文本文件并读取部件号的

详细信息,部件号将作为
$传递b $ b a参数表格2.


B.表格2显示部分编号的所有其他详细信息,例如绘图日期,批准日期,描述等。这些

值放在表格2上。三个按钮可用于

表格2,保存 "取消] " EXIT"允许用户更改

部件号以外的部件号的任何其他详细信息。用户更改任何详细信息保存并退出

应用程序。


要求是,如果用户返回

应用程序第二次。我应该能够在表单1中显示他/她正在处理的部分号码。


如何保留此值并显示它?


希望我已经解释过了。


Suresh

-----原帖-----
Suresh,

看,没有单一的最佳选项。我可以给
一些例子,这些例子最适合应用程序的性质:

a)选项桌面应用程序的对话框。
通常,设置存储在注册表或配置文件中。请
请参阅Microsoft.Win32.Registry类和
System.Configuration命名空间,详细信息和示例。

b)首选项 Web应用程序的Web页面。 Web
应用程序大多数都使用某种数据库,并且通常在数据库中存储
所有信息。有关更多信息和示例,请参阅System.Data
命名空间文档。

c)桌面CRM应用程序中的客户详细信息。这样的
复杂应用程序通常依赖于某种数据库或结构化的
存储。
P.S。事实上,你问的问题是b $ b也是宽带。我建议你面对一个特定的问题,如果你想用b $ b描述你想要实现的东西,我认为社区可以提出更多
的详细建议。
-
Dmitriy Lapshin [C#/ .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
将单元测试的强大功能带到VS .NET IDE

Suresh Kumaran <ク******** @ hotmail.com>在消息中写道
新闻:0e **************************** @ phx.gbl ...

Dmitriy,

这样做的最佳选择是什么?你有一个
样本编码吗?

提前致谢,

Suresh





Dmitriy,


感谢您的回复。我的选择也是一个文本文件。只是

很想知道如何将值编码到

注册表中?你有样品吗? ''在写入注册表之前,我没有写过任何代码的
。在部署项目时,还不知道

注册表是否会导致安全问题?


Suresh

-----原帖-----
Suresh,
现在我明白了。我认为注册表或简单的文本文件
是最好的选择。当用户关闭表单1时,请阅读文本框
值并将其保存到具有相应Framework
类的注册表/文件中。在Form 1st-up上,检查您之前是否存储了价值
并预填充文本框。

- Dmitriy Lapshin [C#/ .NET MVP]
X-Unity测试工作室
http:// x -unity.miik.com.ua/teststudio.aspx
将单元测试的强大功能带到VS .NET IDE

Suresh Kumaran <ク******** @ hotmail.com>在消息中写道
新闻:1a **************************** @ phx.gbl ...

Dmitriy,

感谢您的回复。

好的,这就是我想要的。我的应用程序是使用VB.NET开发的。设计就是这样。

A.表单1旨在让用户输入部件号。
表单1有两个按钮Okay和取消如果用户点击Okay,则验证文本文件并阅读部件号的详细信息,并将部件号作为参数传递给
以形成2.

B.表格2显示部分编号的所有其他详细信息,如绘图日期,批准日期,说明等。这些
值放在表格2上。三个按钮是
availableon表格2,保存 "取消] " EXIT"允许用户
更改零件号以外的零件号的任何其他详细信息。用户更改任何详细信息保存并退出
应用程序。

要求是,如果用户第二次返回
应用程序。我应该能够在表格1中显示他/她正在处理的部分号码。

如何保留这个值并显示它?

希望我已经解释了。

Suresh

> -----原帖-----
> Suresh ,
>
>看,没有单一的最佳选项。我只能
给出

>上的一些例子,哪种方式最适合应用程序的性质:
>
> a)选项桌面应用程序的对话框。


通常设置是

>存储在注册表或配置文件中。


请参考

> Microsoft.Win32.Registry类以及

>更详细的信息和示例的


System.Configuration命名空间。 <>
> b)偏好和偏好。 Web应用程序的Web页面。 Web


应用程序大多数

>经常使用某种数据库并且通常存储


所有信息

> ;在数据库中。有关更多信息和示例,请参阅System.Data


命名空间文档

>
>
> c)客户详细信息桌面CRM应用程序。这样的


复杂的应用程序

>也通常依赖于某种数据库或


结构化存储。

> ;
> PS事实上,你问的问题是


宽带。我建议你

>正面临一个特定的问题,如果你想


描述你想要的东西

>来实现,我想社区可以提出


更详细的建议。

>
> -
> Dmitriy Lapshin [C#/ .NET MVP ]
> X-Unity Test Studio
> http://x-unity.miik.com.ua/teststudio.aspx
>将单元测试的强大功能带到VS .NET IDE
>
>Suresh Kumaran <ク******** @ hotmail.com>写在



message> news:0e ********************** ****** @ phx.gbl ...
>> Dmitriy,
>>
>>这样做的最佳选择是什么?你
有一个>>样本编码?
>>
>>在此先感谢,
>>
>> Suresh
>
>。
>





How do you retain the last value the user keyed in a text
box? I should be able to show the values when the user
runs the executable for the second time.

Appreciate help.
Suresh

解决方案

Suresh,

See, there is no single "best" option. I could just give some examples on
which way fits best the nature of the application:

a) An "Options" dialog box of a desktop application. Usually settings are
stored in the registry or in a configuration file. Please refer to the
Microsoft.Win32.Registry class and to the System.Configuration namespace for
more detailed information and examples.

b) A "Preferences" web page of a Web application. Web applications most
often work with some kind of database and usually store all information
within the database. Please refer to the System.Data namespace documentation
for more info and examples.

c) Customer details in a desktop CRM application. Such complex applications
also usually rely on some kind of database or structured storage.

P.S. In fact, the question you are asking is too "broadband". I suggest you
are facing a particular problem, and if you would describe things you want
to achieve, I think the community could came up with more detailed advice.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Suresh Kumaran" <ku********@hotmail.com> wrote in message
news:0e****************************@phx.gbl...

Dmitriy,

What would be the best option to do this? Do you have a
sample coding on this?

Thanks in advance,

Suresh




Dmitriy,

Thanks for your reply.

All right, here''s what I want. My application is being
developed using VB.NET The design is this.

A. Form 1 designed for user to enter the part number. Form
1 has two buttons "Okay" and "Cancel" If the user
clicks "Okay", a textfile is validated and read for the
details of the partnumber,and the part number is passed as
aparameter to form 2.

B. Form 2 shows all other details of the partnumber such
as drawing date, approved date, description etc. These
values are placed on Form 2. Three button are availableon
form 2, "SAVE" "CANCEL" "EXIT" The user is allowed to
change any other details of the part number other than the
part number. User changes any details saves and exit the
application.

The requirement is that, if the user comes back the
application the second time around. I should be able to
show the partnumber he/she was working on in the Form 1.

How do I retain this value and show it?

Hope I have explained.

Suresh

-----Original Message-----
Suresh,

See, there is no single "best" option. I could just give some examples onwhich way fits best the nature of the application:

a) An "Options" dialog box of a desktop application. Usually settings arestored in the registry or in a configuration file. Please refer to theMicrosoft.Win32.Registry class and to the System.Configuration namespace formore detailed information and examples.

b) A "Preferences" web page of a Web application. Web applications mostoften work with some kind of database and usually store all informationwithin the database. Please refer to the System.Data namespace documentationfor more info and examples.

c) Customer details in a desktop CRM application. Such complex applicationsalso usually rely on some kind of database or structured storage.
P.S. In fact, the question you are asking is too "broadband". I suggest youare facing a particular problem, and if you would describe things you wantto achieve, I think the community could came up with more detailed advice.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Suresh Kumaran" <ku********@hotmail.com> wrote in message
news:0e****************************@phx.gbl...

Dmitriy,

What would be the best option to do this? Do you have a
sample coding on this?

Thanks in advance,

Suresh



.



Dmitriy,

Thanks for your reply. My choice was a text file too. Just
curious to know how do you code the values to the
registry? Do you have a sample. ''Cos I have not written
any codes before to write to the registry. Also won''t the
registry cause a security issue when deploying the project?

Suresh

-----Original Message-----
Suresh,

Now I see. I think registry or a simple text file would be the best choicehere. When the user closes the Form 1, read the text box value and save itto the registry/file with the appropriate Framework classes. And upon Form 1start-up, check whether you have previously stored value and pre-populatethe text box.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Suresh Kumaran" <ku********@hotmail.com> wrote in message
news:1a****************************@phx.gbl...

Dmitriy,

Thanks for your reply.

All right, here''s what I want. My application is being
developed using VB.NET The design is this.

A. Form 1 designed for user to enter the part number. Form 1 has two buttons "Okay" and "Cancel" If the user
clicks "Okay", a textfile is validated and read for the
details of the partnumber,and the part number is passed as aparameter to form 2.

B. Form 2 shows all other details of the partnumber such
as drawing date, approved date, description etc. These
values are placed on Form 2. Three button are availableon form 2, "SAVE" "CANCEL" "EXIT" The user is allowed to change any other details of the part number other than the part number. User changes any details saves and exit the
application.

The requirement is that, if the user comes back the
application the second time around. I should be able to
show the partnumber he/she was working on in the Form 1.

How do I retain this value and show it?

Hope I have explained.

Suresh

>-----Original Message-----
>Suresh,
>
>See, there is no single "best" option. I could just give

some examples on

>which way fits best the nature of the application:
>
>a) An "Options" dialog box of a desktop application.


Usually settings are

>stored in the registry or in a configuration file.

Please refer to the

>Microsoft.Win32.Registry class and to the


System.Configuration namespace for

>more detailed information and examples.
>
>b) A "Preferences" web page of a Web application. Web


applications most

>often work with some kind of database and usually store


all information

>within the database. Please refer to the System.Data


namespace documentation

>for more info and examples.
>
>c) Customer details in a desktop CRM application. Such


complex applications

>also usually rely on some kind of database or

structured storage.

>
>P.S. In fact, the question you are asking is


too "broadband". I suggest you

>are facing a particular problem, and if you would


describe things you want

>to achieve, I think the community could came up with

more detailed advice.

>
>--
>Dmitriy Lapshin [C# / .NET MVP]
>X-Unity Test Studio
>http://x-unity.miik.com.ua/teststudio.aspx
>Bring the power of unit testing to VS .NET IDE
>
>"Suresh Kumaran" <ku********@hotmail.com> wrote in


message >news:0e****************************@phx.gbl...
>> Dmitriy,
>>
>> What would be the best option to do this? Do you have a >> sample coding on this?
>>
>> Thanks in advance,
>>
>> Suresh
>
>.
>



.



这篇关于在VB.NET中保留文本框中的最后一个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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