Access to form1 ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hell
I would like to add some controls on form1 from form3. It would be like this

Form1.Controls.Add(TextBx

but how to make a form1,to be visible for a form3
L
 
I think you need to dim and create a control like this

dim newtextbox as textbox
newtextbox = new textbox

' set some properties
newtextbox.Width = 128
newtextbox.Height = 20
newtextbox.left = 176
newtextbox.top = 88

'addressing another form
'This is a question I have. How do you address the
form1 that is open and not inherit from Form1?

'This code creates a new form you can close the
opened one and show this one.
dim frm1 as form1
frm1 = new form1

'then add control

frm1.control.add(newtextbox)

Hope we both get some better feedback.
 
Hell
But I would like to use an existing form1 and on this form creating a new controls
LB
 
Hi LB

Why should you use that textbox from form3 all textboxes are equal, and if
it is a special one, make your own by inheriting the original one and use it
on form1 and form3.

Then you have only to transport the string in it.

I hope this helps.

Cor
 
This is a fairly common question - add a public variable of form1's type to
form3. Now, assuming that form1 is your main (startup) form, and you create
form3 in code inside form1, just assign Me to the variable in form3 - later
on, you can use that variable to add form3's textbox to form1.
--------------------
Thread-Topic: Access to form1 ?
thread-index: AcQLJSbckSzZ49CpShWp6I3X8voZpg==
X-Tomcat-NG: microsoft.public.dotnet.languages.vb
From: "=?Utf-8?B?TEI=?=" <[email protected]>
References: <[email protected]>
Subject: RE: Access to form1 ?
Date: Mon, 15 Mar 2004 23:06:06 -0800
Lines: 3
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:188819
NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hello
But I would like to use an existing form1 and on this form creating a new
controls.
LB
 
Back
Top