Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 Excel VBA 用户窗体中添加网格线并将对象捕捉到网格线?
我在 Excel VBA 中生成一个带有大量文本框和标签的用户窗体。对齐它们,即使使用自动对齐和分组工具也是相当乏味和耗时的。如果可以使用水平和垂直网格线将对象捕捉到(想想 AutoCAD),则该过程将加快。默认用户窗体有网格点,但没有线,必须为每个对象手动启用捕捉;它不是所有对象的内置默认值。
在 Tools => Options(对话框)/General(选项卡)中打开“Align Controls to Grid”,如下图所示。