从vb6转换为vb.net

时间:2015-08-30 14:34:45

标签: vb.net vb6 vb6-migration

我需要从vb6转换为vb.net

  public Form1()
  {
        InitializeComponent();
  }

也从vb6到vb.net

(picturebox1.TextWidth(RsSearch.Fields(Fs.FieldName)) / 2)

也从vb6到vb.net

picturebox1.Line (x, y) - ((Width +x) / Reducer, (y+ Height) / Reducer), Fs.LineColor

在vb.net中对于图片框中的proprety hdc也意味着什么 picturebox1.hdc

1 个答案:

答案 0 :(得分:1)

在vb.net中,您可以将Graphics类用于这些绘图功能,可以是Paint事件中的picturebox控件,也可以是picturebox图像上的持久图形。例如,绘制一条线:

Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint
  e.Graphics.DrawLine...
End Sub

Dim g As Graphics = Graphics.FromImage(PictureBox1.Image)
  g.DrawLine...