Hi create a new form called input then and copy paste the code below, in the
form where you want the input box to show copy paste the other piece of code
below. I think this will do what you want
hth Peter
'copy paste on the form when you want the inputbox to show
Dim obj As New input()
If obj.ShowDialog = DialogResult.OK Then
MsgBox(obj.giveValue)
End If
'The inputbox
Public Class input
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(194, 8)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(60, 34)
Me.Button1.TabIndex = 0
Me.Button1.Text = "OK"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(6, 14)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(178, 20)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = ""
'
'input
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(262, 59)
Me.Controls.AddRange(New System.Windows.Forms.Control()
{Me.TextBox1, Me.Button1})
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "input"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScree n
Me.Text = "input"
Me.ResumeLayout(False)
End Sub
#End Region
Public ReadOnly Property giveValue() As String
Get
Return TextBox1.Text
End Get
End Property
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
DialogResult = DialogResult.OK
End Sub
End Class
"Cor Ligthert" <no************@planet.nl> wrote in message
news:et**************@TK2MSFTNGP09.phx.gbl...
Michael,
Do you mean changing the borders?
Cor
"Michael Turner"
Hi Guys
That seems to be a new form. I am creating a control and really wanted
it to
popup on form 1, is there away to do this or do i need to use a form.
Mike.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl... "Michael Turner" <fi*****@m-turner.co.uk> schrieb:
> I am in the process of developing a control, and will need it to
> "popup"
> on
> the users for on the press of a button ask for some input and then
> chuck
> the
> information back to the form. Does anyone know how I can develop
this.
Add a form and use it as input window:
\\\
Dim f As New FooForm()
If f.ShowDialog() = DialogResult.OK Then
...
End If
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>