与SplitContainer混淆 [英] Confused with SplitContainer
问题描述
大家好:
我正在开发一个与SQL Server接口的GUI。
I am developing a GUI to interface with SQL Server.
在我的表单上我有一个SplitContainer水平方向。顶部面板 - Panel1有一个ComboBox,用于选择要访问的SQL Server。两个TextBoxes;一个用于LogIn,另一个用于密码。两个按钮;一个连接到服务器,
另一个退出应用程序。另一个ComboBox用于选择您要使用的数据库。
On my form I have a SplitContainer in Horizontal orientation. The top panel - Panel1 has a ComboBox for selecting the SQL Server you want to access. Two TextBoxes; one for LogIn and the other for the password. Two buttons; one to connect to the server and the other to exit the application. The other ComboBox is for selecting the database you want to use.
底部面板 - Panel2包含一个TabControl,每个标签页都是特定表的GUI。
The bottom panel - Panel2 contains a TabControl and each tab page is a GUI for a specific table.
这是我的地方我遇到了问题。完成登录服务器并指定要使用的数据库后。我需要在标签页
Customers上绑定控件。 我不知道将代码放入哪个事件,因此我可以使用BindingSource将控件绑定到导航器。
This is where I am having my problem. After I have finished logging into the server and specifying the database to use. I need to bind the Controls on the tab page Customers. I don't know which event to place the code into so I can bind the controls to the navigator using a BindingSource.
提前致谢,
MRM256
推荐答案
我认为你应该处理
"Database:"组合框的SelectedIndexChanged 。使用字段的当前值来访问数据并绑定选项卡的控件,除非缺少某些值。
I think that you should handle the SelectedIndexChanged of "Database:" combobox. Use the current values of the fields to access the data and bind the controls of the tabs, unless some of the values are missing.
此外,可能会处理其他事件,例如
< "服务器名称:"的em> SelectedIndexChanged ,它应该可以清除绑定和选项卡。
Also, maybe handle other events, such as the SelectedIndexChanged of "Server Name:", which should probably clear bindings and the tabs.
这篇关于与SplitContainer混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!