这该怎么做 ? [英] How to do this ?

查看:62
本文介绍了这该怎么做 ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款有助于计费和维护销售细节的软件。

你知道公司会随着时间的推移不断增加。

我想创建一个用于添加新公司名称及其产品名称的按钮。

问题是我找不到存储细节的方法。

例如:

如果我分发了一个产品名为A,B&C的公司X,我创建的按钮应该输入公司名称及其产品名称。

名称该公司应该显示为单选按钮。

如果我点击该单选按钮并单击该表单上的下一个,则应以新的形式显示一个组合框。当我点击组合框时,下拉产品名称应该显示在组合框中。

请告诉我怎么做?

有没有办法用一些按钮来更新表格创建项目后如上所述?



SHOUTING删除 - Orig inalGriff [/ edit]

I am developing a software which helps in billing and maintain sales details.
You know that companies keep on adding as time goes by.
I thought of creating a button for adding new company name and name of its products.
The problem is I could not find a way to store the details.
For example:
If I get distribution of a company X with products name A,B &C,the button I have created should input the name of the company and its product''s name.
The name of the company should appear as radio button.
If I click on that radio button and click next on that form,in a new form a combo box should be displayed.When I click on the combobox,drop down of the names of the products should be displayed in the combobox.
Please let me know how to do so?
Is there any way to update the form using some buttons as mentioned above after creating a project?

[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案

正如我上次提到的那样:你需要将它存储在文件或应用程序设置中并在你重新加载它们时打开应用程序。



如果您对如何操作有特定问题,请询问,但不要问一般性问题,并期待详细解答。





存储在文件或应用程序设置中是什么意思?

怎么做?




将它们存储在一个文件中非常简单。如果你想添加三家公司--IBM,戴尔和宏碁说,那么你所要做的就是将它们放入一个字符串数组中:

As I said when you asked this last time: you need to store this in a file or in the applications settings and reload them when you open the application.

If you have a specific problem with how to do that, ask about it, but don''t ask a general questions and expect a detailed answer.


"What do you mean by storing in a file or application settings?
How to do that?"


To store them in a file is pretty easy. If you want to add three companies - IBM, Dell and Acer say, then all you have to do is put them into an array of strings:
Private Sub saveCompanies()
	Dim company1 As String = "IBM"
	Dim company2 As String = "Dell"
	Dim company3 As String = "Acer"
	Dim companies As String() = New String(2) {}
	companies(0) = company1
	companies(1) = company2
	companies(2) = company3
	File.WriteAllLines("D:\Temp\MyCompanies.txt", companies)
End Sub
Private Sub loadCompanies()
	Dim companies As String() = File.ReadAllLines("D:\Temp\MyCompanies.txt")
	For Each company As String In companies
		Console.WriteLine(company)
	Next
End Sub

显然,大多数代码只是设置数据 - 您可能会使用字符串列表并在创建控件时添加它们。然后,您可以直接使用List将名称保存在文件中,而不是我显示的数组。

当您阅读它们时,您可以使用几乎已有的代码创建控件,只需取而代之的是每个名字,而不是将其写入控制台。



通过程序设置来实现它有点困难,但不是很多 - 尝试首先是文件!

Obviously, most of that code is just setting up the data - you would probably use a List of strings and add them as you create the controls. You can then use the List directly to save the names in the file instead of an array as I showed.
When you read them out, you create your controls using pretty much the code you have already, just taking each name as it comes in turn instead of writing it to the console.

To do it via the program settings is a little harder, but not a lot - try it with a file first!


使用应用程序首选项我认为这比从文件访问要容易得多

http://msdn.microsoft.com/en-us/magazine/cc163812.aspx [ ^ ]
Use application preferences I think it would be very easy than accessing from files
http://msdn.microsoft.com/en-us/magazine/cc163812.aspx[^]


这篇关于这该怎么做 ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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