I created an OCX using VB6. I put a picturebox (called graph) 4 textboxes and 1 command button (command1) on a form. I type numbers in the textboxes and then click on the command button.
The result is a graph grid in the picturebox.
See code below.
'=====================
Private Sub Command1_Click()
Xmin = Xmin.Text
Xmax = Xmax.Text
Ymin = Ymin.Text
Ymax = Ymax.Text
graph.Scale (Xmin, Ymax)-(Xmax, Ymin)
graph.Line (Xmin, 0)-(Xmax, 0)
graph.Line (0, Ymax)-(0, Ymin)
For H0 = Xmin To Xmax
For V0 = Ymin To Ymax
graph.Circle (H0, V0), 0.1
Next V0
Next H0
End Sub
'====================
I'm able to add this control in Word and after I type numbers in the textboxes and click command1 the graph appears in the picturebox.
Problem is, if I save, close the doc then reopen it, the graph is gone. The control is still there.
How can I change the code so that the graph is drawn on the doc and the control disappears?
Mathprof
The result is a graph grid in the picturebox.
See code below.
'=====================
Private Sub Command1_Click()
Xmin = Xmin.Text
Xmax = Xmax.Text
Ymin = Ymin.Text
Ymax = Ymax.Text
graph.Scale (Xmin, Ymax)-(Xmax, Ymin)
graph.Line (Xmin, 0)-(Xmax, 0)
graph.Line (0, Ymax)-(0, Ymin)
For H0 = Xmin To Xmax
For V0 = Ymin To Ymax
graph.Circle (H0, V0), 0.1
Next V0
Next H0
End Sub
'====================
I'm able to add this control in Word and after I type numbers in the textboxes and click command1 the graph appears in the picturebox.
Problem is, if I save, close the doc then reopen it, the graph is gone. The control is still there.
How can I change the code so that the graph is drawn on the doc and the control disappears?
Mathprof