简体   繁体   English

如何在面板中放大和缩小?

[英]How to Zoom in and Zoom out in a Panel?

I have a Panel which have 我有一个小组

  1. Five labels in it 里面有五个标签
  2. Two lines one is Vertical and other is Horizontal drawn at run time 在运行时绘制两条线,一条是垂直线,另一条是水平线
  3. An Ellipse drawn at run time 在运行时绘制的椭圆
  4. And Some Strings which are also drawn at run time 还有一些在运行时绘制的字符串

Now I want to zoom this Panel and every thing in it 现在我要缩放此面板及其中的所有内容

How can I solve this problem? 我怎么解决这个问题?

First you have to set the Anchor to all 4 sides for all controls in the panel, resizing the panel will resize the controls also. 首先,您必须将面板中所有控件的“锚定”设置为所有4个侧面,调整面板的大小也会同时调整控件的大小。

Here is the Code. 这是代码。

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Panel1.Width = Panel1.Width + 10
    Panel1.Height = Panel1.Height + 10
End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM