By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,813 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

Popup Control

P: n/a
Hi Guys

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.

Thanks,
Mike.

Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Check out the form.showdialog method

for example form2 is the form you want to show as input form on form1

on form1:

dim input as as new form2
if input.showdialog = dialogresult.ok then
variable = input.nameOfAPropertyOnForm2
end if

on form2 set an ok button and in the buttons click event set dialogresult =
dialogresult.ok
hth Peter

"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:Og**************@TK2MSFTNGP11.phx.gbl...
Hi Guys

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.

Thanks,
Mike.

Nov 21 '05 #2

P: n/a
"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/>

Nov 21 '05 #3

P: n/a
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/>


Nov 21 '05 #4

P: n/a
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/>


Nov 21 '05 #5

P: n/a
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/>



Nov 21 '05 #6

P: n/a
"Michael Turner" <fi*****@m-turner.co.uk> schrieb:
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.


<URL:http://vbaccelerator.com/article.asp?id=13309>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #7

P: n/a
Cheers Guys

Thats Great!

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uc**************@TK2MSFTNGP15.phx.gbl...
"Michael Turner" <fi*****@m-turner.co.uk> schrieb:
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\0\0\0>

<URL:http://vbaccelerator.com/article.asp?id=13309>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.