本文介绍了如何模拟鼠标单击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个带有6个标签的标签控件。 我想要一个特定的选项卡进入视图并显示其内容 - 就像用户在其上单击鼠标一样 - 基于表单上的用户交互。 例如在一个标签上有一个包含股票信息的数据网格,当使用双击带有股票代码的列时,我会在另一个标签上加载该图表的图表。 这样可以正常工作,但是我没有能够在没有实际点击选项卡的情况下将图表弹出视图。 我试过了: tabControl1.TabPages [( int ) TabSet1 。图表] .Select(); tabControl1.TabPages [( int ) TabSet1 。图表] .Focus();I have a tab control with 6 tabs. I want a specific tab to come into view and display its contents - just as if the user has clicked the mouse on it - based on user interaction on the form. e.g. On one tab there is a datagrid with stock information, and when the use double-clicks on the column with the stock symbol, I load the graph for that chart on another tab. This works fine, but I haven't been able to then have the chart pop into view without physically clicking on the tab.I have tried: tabControl1.TabPages[(int)TabSet1.CHARTING].Select();tabControl1.TabPages[(int)TabSet1.CHARTING].Focus(); tabControl1.TabPages [( int ) TabSet1 。图表]。显示(); 我接近一点 - 但没有雪茄。 使用此行,当前选项卡变为空白(数据网格和按钮消失),但所需的选项卡仍然保持着诱人的隐藏。 请注意,我不一定要尝试调用任何代码。 tabcontrol的Click()事件,只需使所需的选项卡成为活动控件并显示其内容,而无需用户实际点击它。 TIA rcatabControl1.TabPages[(int)TabSet1.CHARTING].Show();I get a little closer -- but no cigar. With this line, the current tab goes blank (the datagrid and buttons disappear) but the desired tab still remains tantalizingly hidden.Note that I am not necessarily trying to invoke any code in the tabcontrol's Click() event, just make the desired tab become the active control and display its contents without the user having to physically click on it.TIArca推荐答案 这篇关于如何模拟鼠标单击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-07 02:22