问题标签 [tabpage]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
5081 浏览

asp.net - ASP Tabpanel 仅在一个选项卡上回发

我在第 4 个选项卡上有一个带有日历控件的选项卡,但是当我选择一个日期时,回发会导致选项卡面板返回到第一个选项卡,而不是它来自的第 4 个选项卡。有没有办法让它返回到日历控件所在的选项卡而不是恢复到第一个选项卡?

我知道在 TabContainer 上将 autoPostback 设置为 true 会执行此操作,但这意味着它会在每个选项卡更改时重新加载,而不仅仅是我想要的。

有任何想法吗 ?

0 投票
1 回答
5928 浏览

winforms - 自动调整 TabPages 中的控件大小

我有一个由几个 TabPages 组成的 TabControl。其中一个 TabPages 包含一个 TreeView,另一个包含一个 DataGridView。我希望这些控件(和标签页)自动调整为 TabControl 中允许的最大大小而不滚动。

DataGridView 包含一个继承自 Control 的 AutoSize 属性,如果启用,该属性会使控件出现乱码。TreeView 没有这个属性。我尝试将 Size 设置为等于 TabControl.Size ,但这不考虑边框大小和 Tabbar 高度。

treeView.Size = new Size(tabControl.Size.Width - SystemInformation.Border3DSize.Width * 2, tabControl.Size.Height - SystemInformation.Border3DSize.Height * 2);

我的问题是:如何确定 Tab 按钮的高度,或者如何使用单个控件自动将 TabPages 填充到最大尺寸?

0 投票
22 回答
333671 浏览

c# - 如何从 TabControl 隐藏 TabPage

如何在 WinForms 2.0 中从 TabControl 中隐藏 TabPage?

0 投票
2 回答
652 浏览

c# - UserControl inflates when placed on a form?

EDIT > SOLVED: It turns out that I had set all of the UI elements' font properties to be 14pt Arial, but not the usercontrol itself, so when it was drawing it on the form, it was resizing it all. Changing the usercontrol's font size to 14pt Arial, and then repositioning/resizing everything fixed it.

I started working on the UI for an app I'm making. The app has a devexpress tab control, and initially I was just placing all of my controls in there to see what it'd look like and to work out any layout issues. Well, I decide to pull out all of the ui elements for each tabpage and toss them into a UserControl and to have that UserControl fill the tab page.

The problem is that it looks perfectly normal (ie. the same as before) when in the usercontrol but when I bring that over to the tab page, all of the ui elements are HUGE (about double in size, but not exactly double).

Here's some images to show you what I mean.

Edit> Note: This is a winforms app.

UserControl:

edit > images removed

Form:

edit > images removed

It turns out that the objects are being resized. I checked the .Size property of the ui elements after the usercontrol.load event and they are much larger than they are supposed to be. This happens if there is the anchoring as I'd like it, all top-left anchored and no anchoring at all.

0 投票
2 回答
53320 浏览

c# - C# TabControl TabPage 更改

如何以编程方式更改在我的选项卡控件中显示的选项卡页?

0 投票
1 回答
2979 浏览

c# - 创建选项卡式 MDI 界面

我正在使用 C# 2005 开发 Windows 应用程序。我打算使用选项卡容器来显示子表单。我使用了菜单条来显示菜单并设置了 MainMenu 表单的 IsMDIContainer = true 属性。MainMenu 表单还包含一个选项卡控件,我计划在选项卡控件中将所有子表单显示为 Tap Pages。

到目前为止,当用户选择菜单选项时,我已经能够添加标签页。但我不知道如何在标签页中显示子表单本身。

我在菜单点击事件中使用了以下代码。

如何在标签页中正确显示子表单?我不想要一个文件-> 新类型的应用程序,其中菜单单击事件显示相同的(空白)表单。我的菜单选项应该每个都显示一个独特/不同的形式。

谢谢你。

拉利特·库马尔·巴里克

0 投票
1 回答
1746 浏览

c# - 删除标签页

我正在使用 C# 2005 创建一个 Windows 应用程序。我有一个 MDIForm (frmMainMenu),其中包含一个 Menustrip 和一个

选项卡控件。我的 ChildForm 是 frmPurchaseEntry。当用户单击特定的菜单选项时,会创建一个新的 TabPage 并

子窗体显示在 TabPage 内。

我在 MDIForm (frmMainMenu) 的 MenuClick 事件中使用以下代码:

一切都很好。但是当 ChildForm 关闭时,我无法删除 TabPage。仅以下命令

关闭 ChildForm,但空的 TabPage 仍然存在。

我知道删除 TabPage 的语法是

但我无法从 ChildForm 访问 MDIForm 的 TabControl。我尝试对 TabControl 使用 Public 修饰符,但是

它仍然没有从 ChildForm 中暴露出来。

如何从 ChildForm 中删除并处理特定的 TabPage(带有特定的选项卡文本)???

谢谢你。

拉利特·库马尔·巴里克

0 投票
0 回答
599 浏览

c# - .Net DataGridViews 绑定到不同标签页中的相同绑定源

我有一个带有选项卡控件的 winform (C# VS2008 .net 3.5)。选项卡控件上的两个页面具有绑定到相同绑定源的数据网格视图。这工作正常。

但是,选项卡页存在一个错误,即选项卡页中的数据网格视图始终显示绑定表的第一列,无论它在设计时是否设置为可见。

要解决此问题,您只需手动将 column.visible 属性设置为 false。当我只有一个 DGV 绑定到 BindingSource 时,这很好用。随着两人的束缚,一些奇怪的事情发生了。我手动将 DGV 的第一列都设置为可见 = false,但有时实际上只有一个列,而该列仍然显示在另一列中。此外,当单击 DGV 中显示第一列的记录时,会引发以下异常:

InvalidOperationException - 操作无效,因为它会导致对 SetCurrentCellAddressCore 函数的可重入调用。

有没有其他人遇到过这种情况或对标签页的列 [0] 问题有更好的解决方案?

0 投票
1 回答
1342 浏览

c# - 使标签页不处理鼠标滚轮事件(C#)

我制作了一个在 TabPages 中使用 PictureBoxes 的 MDI(选项卡式)应用程序。图片框有时比标签页大,因此会出现滚动条。它是使用 Windows 窗体用 C# 编写的。

在我的标签页中,我在 MouseWheel 事件中捕获和处理鼠标滚轮事件(我用它来旋转我在图片框中绘制的一些对象)。

但是当我有滚动条时,当我旋转鼠标滚轮时,我的对象会旋转,但标签页也会向下滚动。

如何使标签页不处理鼠标滚轮事件,从而使其不向下滚动?我希望它只有在用户单击并拖动滚动条时才能滚动。

0 投票
3 回答
8032 浏览

c# - Visual Studio - TabControl.TabPages.Insert 不起作用

这是我的代码:

简而言之,它读取配置文件中的一个部分,并为该部分中的每个元素创建一个选项卡。

我已经在设计时创建了一个静态 TabPage。我希望在此静态选项卡之前插入动态创建的选项卡。

运行此代码,tabcontrol 仅显示静态标签页。

如果我做这个改变:

使用 Add 方法显示所有页面。但我没有得到我想要的订单。

Insert 方法有什么我不明白的地方吗?为什么它不起作用?