Home > Software engineering >  For help - create dynamic control
For help - create dynamic control

Time:10-06

Excuse me: by a button control created two dynamic form, dynamically add a button control in each form, the runtime will occur at the same time two forms (as follows)
How to realize the two dynamic form not appear at the same time, such as using an event for the tandem display), I want to pass the first dynamic form of a button control to control the second dynamic forms appear, I do not know how to implement, cattle people advice please?

 Public Class Form1 

Private Sub Button1_Click (ByVal sender As System. Object, ByVal e the As System. EventArgs) Handles for. Click
For I=1 To 2
Dim Form1 As New Form
Form1. The Show ()
Form1. Name="frmStudy" & amp; I
Form1. Text="Product" & amp; I
Dim BTN As New Button
Form1. Controls. The Add (BTN)
With BTN
Location=New Point (150, 150)
Size=New Size (95, 35)
. The Text="next step"
.name="btnOk" & amp; I
The Tag=Form1
The Enabled=True
End With
AddHandler BTN. Click AddressOf btnOK_click
Next
End Sub

Private Sub btnOK_click (ByVal sender As System. Object, ByVal e the As System. EventArgs)

End Sub

End the Class

CodePudding user response:

Why don't you put a Timer control timing display.

CodePudding user response:

 Dim after the As a Double 
After=Now + 2 # 24 #/3600 #/
Do
DoEvents
If Now & gt; After Then Exit the Do
Loop

CodePudding user response:

# 1 hello teacher, because there are some other controls in each form, such as text control, according to the need in the input, the length of time is uncertain, how to use the timer control? How to use the first dynamic form of inside control trigger the second dynamic forms appear?

CodePudding user response:

# 2 the teacher hello, I am in practice while learning, have some code code is not very clear, such as after=Now + 24 #/3600 #, 2 #/I don't quite understand, and you this code in any control, what role? thank you

CodePudding user response:

In you Form1. The Show (), have been confirmed will be displayed in a start up, change here.
  • Related