11-17-2010, 04:30 PM
You will have to use Label class for that. In the example below- you will find the use of Label to add the instructions to a Form
hope that helps.
Code:
Set MyForm = DotNetFactory.CreateInstance("System.Windows.Forms.Form", "System.Windows.Forms")
Set MyText = DotNetFactory.CreateInstance("System.Windows.Forms.TextBox", "System.Windows.Forms")
Set MyButton = DotNetFactory.CreateInstance("System.Windows.Forms.Button", "System.Windows.Forms")
Set MyLabel = DotNetFactory.CreateInstance("System.Windows.Forms.Label", "System.Windows.Forms")
Set Pos = DotNetFactory.CreateInstance("System.Drawing.Point","System.Drawing",x,y)
MyLabel.Text = "Please enter some text into the text box below and click on close button"
MyLabel.AutoSize = True
Pos.X = 90
Pos.Y = 100
MyText.Location = Pos
MyText.Width = 100
Pos.X = 100
Pos.Y = 130
MyButton.Location = Pos
MyButton.Text = "Close"
MyForm.Controls.Add MyLabel
MyForm.Controls.Add MyText
MyForm.Controls.Add MyButton
MyForm.CancelButton = MyButton
MyForm.ShowDialog
Msgbox MyText.Text
Set MyText = Nothing
Set MyButton = Nothing
Set Pos = Nothing
Set MyForm = Nothing
hope that helps.