HI
I have created 2 forms
In form1 ,there are 3 textboxes,for x,y coordinates and radius and one button also
if i enter the x,y,r values in the form1 and i wanted to see the circle in form 2 in the centre,
anyone can pls help me,
Form1
Public Class Form1
Dim x As Double
Dim y As Double
Dim r As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Form2 As New Form2()
Form2.ShowDialog()
End Sub
End Class
Form2
Option Strict On
Public Class Form2
Private Sub form1_paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim form1 As New Form1()
Me.BackColor = Color.Black
Dim centreX As Double = form1.TextBox1
Dim centreY As Double = form1.TextBox2
Dim apen As New Pen(Color.White, 1)
Dim radius As Double = form1.TextBox3
Const Pi As Double = Math.PI
Dim x1, y1 As Integer
For num As Double = 0 To 2 * Pi Step 0.01
x1 = Convert.ToInt32(radius * Math.Cos(num) centreX)
y1 = Convert.ToInt32(radius * Math.Sin(num) centreY)
e.Graphics.DrawLine(apen, x1, y1, x1 1, y1)
Next
End Sub
End Class
Option Strict OnPublic Class Form2 Private Sub form1_paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Dim form1 As New Form1() Me.BackColor = Color.Black Dim centreX As Double = form1.TextBox1 Dim centreY As Double = form1.TextBox2 Dim apen As New Pen(Color.White, 1) Dim radius As Double = form1.TextBox3 Const Pi As Double = Math.PI Dim x1, y1 As Integer For num As Double = 0 To 2 * Pi Step 0.01 x1 = Convert.ToInt32(radius * Math.Cos(num) centreX) y1 = Convert.ToInt32(radius * Math.Sin(num) centreY) e.Graphics.DrawLine(apen, x1, y1, x1 1, y1) Next
End Sub
End Class
and Now i found some error messageslike
option strict on disallows implicts conversation from string to double
so pls help out
Tags: