Create TextBox Pop up in Code Section using VB
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-05-18 03:39 PM
Hi,
i recently create a simple code in VB for launch a MessageBox (pop up) just by adding :
Dim Buttons As MessageBoxButtons = MessageBoxButtons.Ok
MessageBox.Show(input,caption,Buttons)
I know that i have to declare method, global variable... in the GLOBAL CODE SECTION
I want to create a TEXTBOX, (a pop up with a text field within).
I truly need help !!!
Best regards,
Noé P
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-05-18 10:46 PM
Noé - you need to do some research on .Net development, there are thousands of examples out there. But remember BP is not an IDE, and you'll soon get frustrated trying to develop custom code in BP. It's far easier to get things working in something like Visual Studio and then paste into BP.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-05-18 12:47 PM
Hi,
Add System.Windows.Forms.dll referance
and take one code stage where Message and Title should be input text and Result should be Output text
and use below code:
Result=""""
Dim Form as new System.Windows.Forms.Form
Form.Text = Title
Form.Size = New System.Drawing.Size(500,150)
Form.FormBorderStyle =System.Windows.Forms.FormBorderStyle.FixedDialog
Form.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Dim ConfigLabel as new System.Windows.Forms.Label
ConfigLabel.Text = Message
ConfigLabel.Location = New System.Drawing.Point(50,20)
ConfigLabel.Width=350
Form.Controls.Add(ConfigLabel)
Dim TextInput as new System.Windows.Forms.TextBox
TextInput.Text = """"
TextInput.Location = New System.Drawing.Point(50,50)
TextInput.Width=400
Form.Controls.Add(TextInput)
dim OKButton as new System.Windows.Forms.Button
OKButton.Location = New System.Drawing.Point(350,70)
OKButton.Width = 100
OKButton.Text = ""OK""
OKButton.DialogResult = System.Windows.Forms.DialogResult.OK
Form.AcceptButton = OKButton
Form.Controls.Add(OKButton)
Dim ButtonResult As System.Windows.Forms.DialogResult
ButtonResult=Form.ShowDialog()
If ButtonResult=1 Then
Result=TextInput.Text
else
Result=""""
end if
