问题标签 [toolstripbutton]

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 回答
1942 浏览

automation - ToolStrip 按钮点击问题的自动化

我正在尝试使用 vb.net 自动化 Windows 窗体应用程序。我没有想要自动化的程序的源代码。

使用 Spy++,到目前为止,我一直在使用按钮的句柄,并且一直在单击按钮而没有问题。但是,我偶然发现了工具条按钮的问题,我一直在努力解决它。这些按钮是隐藏的或不可见的(从我读过的内容来看),它们没有出现在 spy++ 中,所以它们似乎没有句柄;因此,我不能使用按钮的句柄来单击它,因为它不存在。

为了解决这个问题,我不得不将鼠标光标移动到特定的屏幕位置,重新定位窗口并启动鼠标单击事件。这种方法不是最好的,因为在自动化代码运行时无法使用鼠标。任何人都可以提出替代方案吗?我已经在互联网和这个网站上搜寻了三天的解决方案,但没有成功。

任何帮助,将不胜感激。

0 投票
0 回答
575 浏览

c# - ToolStripButton 工具提示位置错误

我有一个带有几个ToolStripButtons工具提示的 ToolStrip。当我突出显示任何按钮时,工具提示显示得很好,但它的位置离光标有点远。

我不知道为什么会发生这种情况,我试图解决它但无济于事。我附上了一个屏幕截图来显示问题。

在此处输入图像描述

0 投票
1 回答
597 浏览

c# - How to add to ContextMenuStrip and ToolStrip same ToolStripButtons?

I have tool bar in my app and context menu with the same options, so I want to add ToolStripButtons to both ContextMenuStrip and ToolStrip, unfortunately I can't do this. Even when I add manually items to both it shows only on one.

For now I have buttons in tool bar:

I want something like this. I want this options to be one, because I will be often enable and disable this buttons and finally there is one option so why two buttons?

0 投票
1 回答
69 浏览

vb.net - vb.net 中的工具条按钮错误

我有一个包含以下代码的工具条按钮:

它只工作一次,例如,如果我的 datagridview 单元格包含全零,则总数为零,然后当我在列的第一行中输入数字时(例如我输入 5),总数再次为零。

但是,如果我将此代码放在一个按钮中,它就可以正常工作。

谢谢你。

0 投票
1 回答
811 浏览

c# - 在 C# VS 2008 中不按住 ALT 键的情况下重新排序同一 toolStrip 中的 toolStrip 项目

我在 C# 中的表单 (System.Windows.Forms) 上放置了一个 toolStrip1,并向其中添加了五个 toolStrip 按钮。现在我想知道如何让用户通过将它们拖动到 toolStrip1 中的另一个位置来重新排序这些按钮。正如微软在一篇文章中建议的那样,我将toolStrip1.AllowItemReorder 设置为 true,并将AllowDrop 设置为 false 。

现在应该在 toolStrip1 中启用项目重新排序的自动处理。但它不起作用 - 只有当我按住 ALT 键时,toolStrip1 才会对用户的重新排序尝试做出反应。我真的要自己处理DragEvent、DragEnter、DragLeave以避免在重新排序项目期间按住 Alt 键吗?

如果是这样,请给我一个示例,如果我希望在不按住任何 ALT 键的情况下将一个项目拖动到 toolStrip1 中的不同位置(如 Internet Explorer 收藏夹那样),则此事件在带有 toolStripButtons 的 toolStrip 上的外观如何。我在这件事上没有经验。

0 投票
3 回答
741 浏览

c# - 选择/取消选择 ToolStripButton

我尝试在 ToolStripButton 上制作闪烁效果。通过使用 Select() 方法,我可以给它鼠标悬停效果,但我不知道如何让它恢复到正常状态。

编辑:我通过在同一个 ToolStip 上制作一个虚拟 ToolStripButton 并将其大小更改为 0,0 来解决这个问题。

0 投票
2 回答
43 浏览

windows - 如何添加计时事件

有没有办法当我单击 ToolStripButton 时,它会显示 WaitCursor 并更新 StatusStrip 约 10 秒,然后恢复正常。我只是不知道如何输入编码。

如果有人可以指导我完成整个过程。(甚至给我代码)

谢谢你

J马洪

0 投票
1 回答
496 浏览

c# - Create a Toolstrip for each Toolstripbutton located on a main Toolstrip

I want to create a Toolstrip and for each ToolStripButton. I also want to create a Toolstrip below the first, in this way each Toolstrip dynamically appear when I click on a ToolStripButton.

I have tried to create the main Toolstrip with Visual Studio designer and for the other toolstrips below I tried to use a customize Toolstrip class. But when I tried to add them:

they appeared above of the main Toolstrip.

Here is my CustomToolStrip class:

Form:

Result:

http://s16.postimg.org/9kgh0xmh1/Capture.png

Toolstrip 1 and 2 both have the property dock = top.

What can I do to get the Toolstrip 2 below the Toolstrip 1 ?

Could someone guide me please...

0 投票
2 回答
5463 浏览

c# - 如何在不先单击表单的情况下立即单击 ToolStrip 按钮?

我有一个带有包含按钮的工具条的 Windows 窗体应用程序。令人沮丧的是,当表单没有聚焦时,我必须在任何按钮上单击两次才能触发它。第一次单击似乎激活了表单,然后第二次单击单击了按钮(或者,我可以单击表单上的任意位置,然后单击一次按钮)。我该如何解决这个问题,即使没有激活表单,我也可以直接单击按钮?

编辑:我觉得这应该是可行的,因为它适用于 SQL Server Profiler 和 Visual Studio 等程序(不是这些使用 WinForms,但它表明这不是操作系统问题)。

0 投票
0 回答
533 浏览

vb.net - 使用模块将表单相互连接

我是编程新手,在 VB.net 中遇到问题

对于一个有几个表单的项目,我想使用一个模块来自动加载表单中的菜单(工具条)(一种 Web 开发中的 CSS)。这是第一次,但如果我重复该操作,菜单就会消失。(例如司机>出租车>司机)。

我认为错误是当我(重新)加载表单时。

这是我的代码

模块代码

宣言:

tsMenu 的属性

(图片为导入图片)

公共潜艇

两种形式的代码

我不知道这是否重要,但对于我的大多数表单,我使用数据集。谁能帮帮我吗?我会感谢你一千次。:D