VB.NET表格高度问题

时间:2020-03-05 18:45:24  来源:igfitidea点击:

我有一个VB6.0项目,我想在VB.Net中进行转换。

在我的VB6.0应用程序中,某些MDI子窗体的高度为17000,宽度为13000。 。

如何以相同的分辨率增加表格尺寸?

我也想从这里打印,所以我不能使用vb.net表单的自动滚动属性。

解冻

解决方案

回答

我认为VB6单元与VB.Net单元不一样。因此,我们必须进行一次转换。

回答

经典VB单元处于"抽动"状态。我们最有可能将这些数字除以12或者15(取决于我们使用的是大字体还是小字体),并且将获得一定数量的像素。

回答

我对此进行了一些谷歌搜索,并发现了这一点。

Yes, this size of the form is limited
  to the size of the desktop (more
  specifcally
  SystemInformation.MaxWindowTrackSize).
  This is done in the Form.SetBoundsCore
  protected virtual method. This
  behaviour cannot be changes or at
  least without a great deal of work and
  using PInvoke.

在这里也支持

The size of the form in the designer
  is limited by your screen size.
  
  It sounds like you have your display
  at 1600x1200, hence the designer won't
  let you go larger then 1212.
  
  If you had your display at 1280x1024,
  then the designer wouldn't let you go
  larger then 1036.
  
  I'm not really sure why the size of
  the form in the designer is limited to
  the screen size, as I may deploy on a
  machine that has a larger screen size
  them my development machine...

看来这是不可能完成的。这就是一些奇怪的行为,因为看来我们只能使用自己的开发机器。

我认为唯一的方法是将尺寸调整为最大可能的分辨率,设置表格尺寸,然后再还原,但再也不要触摸尺寸了。

回答

我们受限于设计器,但不受代码限制:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.Height = 17000 'or whatever you need
    Me.Width = 13000
End Sub