vuduckien2011
New member
- Joined
- Sep 7, 2016
- Messages
- 3
- Programming Experience
- Beginner
Hi everybody. I need help on properties and scaleHeight ScaleWidth when converting code from vb6 to VB.net . Hope everybody help please?
Public Sub Plot_dothi(ByRef N As Integer)
Pct1.ScaleWidth = Pct1W
For i = 1 To Pct1W - 1
Pct1.Line (i, Pct1.ScaleHeight - mang(i + STTKenhcu))-(i, Pct1.ScaleHeight), &HFFFF00, B
Next i
Pct1.Line (N, Pct1.ScaleHeight)-(N, 0), RGB(255, 255, 255)
End sub
Private Sub Pct1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
STTKenhmoi = STTKenhcu + Round(x)
vitridanhdau = Round(x)
Display (STTKenhmoi)
End Sub
Private Sub Pct1_Click()
Plot_dothi (vitridanhdau)
End Sub
Private thmb = New Bitmap(CInt(4096), CInt(650)) private Graphics As Graphics = Graphics.FromImage(thmb) Private Sub drawLine(Gr As Graphics, Pn As Pen, X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As Integer) Dim ScaledX1 As Integer = CInt(Math.Round((CSng(X1) / Pct1W) * Pct1.ClientSize.Width)) Dim ScaledX2 As Integer = CInt(Math.Round((CSng(X2) / Pct1W) * Pct1.ClientSize.Width)) Dim ScaledY1 As Integer = CInt(Math.Round((CSng(Y1) / mScaleHeight) * Pct1.ClientSize.Height)) Dim ScaledY2 As Integer = CInt(Math.Round((CSng(Y2) / mScaleHeight) * Pct1.ClientSize.Height)) Gr.DrawLine(Pn, ScaledX1, ScaledY1, ScaledX2, ScaledY2) End Sub Public Sub Plot_dothi(ByRef N As Integer) For i = 1 To Pct1W - 1 drawLine(Graphics, Pens.Cyan, i, mScaleHeight - mang(i + STTKenhcu), i, mScaleHeight) Next i Pct1.Image = thmb drawLine(Graphics, Pens.WhiteSmoke, N, mScaleHeight, N, 0) End sub Private Sub Pct1_MouseDown(sender As Object, e As MouseEventArgs) Handles Pct1.MouseDown STTKenhmoi = STTKenhcu + Math.Round(e.X) vitridanhdau = Math.Round(e.X) Display(STTKenhmoi) End Sub Private Sub Pct1_Click(sender As Object, e As EventArgs) Handles Pct1.Click Plot_dothi(vitridanhdau) End Sub