Anyone have knowledge on how to make a label during run time which it depends on the user on how many label should be made i have tried some codes but it won't work.
Option Explicit
Dim m_memo, m_size, m_equation, m_jobs As String
Dim i As Integer
Dim lblfield As Label
Private Sub Form_Load()
Form1.Width = 5055
Form1.Height = 3600
Frame1.Visible = True
Frame2.Visible = False
End Sub
Private Sub txtmemo_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
m_memo = txtmemo.Text
txtsize.SetFocus
End If
End Sub
Private Sub txtsize_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
m_size = txtsize.Text
txtjobs.SetFocus
End If
End Sub
Private Sub txtjobs_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
m_jobs = txtjobs.Text
End If
End Sub
Private Sub cmdsub_Click()
Dim lbl As Control
Frame1.Visible = False
Frame2.Visible = True
Form1.Width = 8640
Form1.Height = 4530
If m_memo Mod 2 = 0 Then
m_equation = m_memo / m_size
Else
MsgBox "invalid memory size,ERROR"
End If
End Sub
Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)
'--it displays nothing unless if i put it on the submit button but it also gives an error..but i want it to display into another frame that's why i put the code here..
Dim lbl As Control
For i = 0 To m_equation
'-- down here i don't know if i get it correct i want to display it into another frame after i click the submit button
Set lbl = Me.Controls.Add("forms.label.l")
With lbl
.Top = 10
.Left = 5
.Height = m_memo
.Width = 40
.BackColor = &HFF&
.ForeColor = &H8000&
.Caption = "lbl" + (i)
.Visible = True
End With
hope you could help me with this one
regards
androidz