如何使面板表现得像表单的模式
我有一个 MDI 子窗体,它显示数据库中已有的项目。我使用 datagridview (PostedItemsDataGrid) 来显示项目...我还有一个按钮,使用户能够编辑在 datagridview 中选择的行。除了指定的两个控件之外,窗体上还有其他控件。
我使用包含各种控件的面板(名称:UpdateItemsPanel)来编辑所选项目...我想以模态方式显示此表单...即...当此表单处于活动状态时,不应允许用户访问其他任何控件与 UpdateItemsPanel 中的控件相比。
我尝试了以下方法,但遇到了其他问题...如果您能帮助我解决主要问题或其中一个问题,那将是很大的帮助。
我尝试将 UpdateItemsPanel 的内容放入单独的表单中并将其显示为模式...问题是将更新表单显示为模式,也会阻止所有其他 MDI 表单。
这个 1 的其他问题是,我需要将模态表单定位在 PostedItemsDataGrid 的正下方...我不确定如何做...
我尝试将其他控件放在面板中,并在显示 updatepanel 时禁用该面板。当然,这会使 (PostedItemsDataGrid) 被禁用,因此无法滚动...
您能帮忙吗...请让我知道,以防您需要更多信息...
I have a MDI child Form which displays items that are already in the database. I use a datagridview (PostedItemsDataGrid) to display the items... I also have a Button which enables user to edit the line selected in the datagridview. There are also other controls on the form other than the two controls specified.
I use a panel (Name : UpdateItemsPanel) containing various controls to edit the item selected... I want to display this form Modally... ie... When this form is active, user should not be allowed to access any controls other than the controls in the UpdateItemsPanel.
I tried the following but got into other problems... If you can help me in solve either the main or one of these problems, it would be great help.
I tried putting the contents of UpdateItemsPanel in a seperate form and show it as modal... The trouble was showing the update form as modal, blocks all other MDI forms also.
Other problem with this 1 is, I need to position the modalform just below the PostedItemsDataGrid... I'm not sure How to do it...
I tried putting the other controls in a panel and disabling the panel when updatepanel is displayed. This ofcourse, makes the (PostedItemsDataGrid) disabled and hence unable to scroll...
Could you please help.... Please let me know, incase you need more info...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试 Control.Validating事件并在 Validating 事件委托中将 CancelEventArgs 的 Cancel 属性设置为 true。
You can try Control.Validating event and set the Cancel property of the CancelEventArgs to true in the Validating event delegate.