473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Multi Forms

Hi all! Supppose I one main form (frmMain), and another one (form2).
All I want to do is that, when I click a button on frmMain, form2 will
show up, and then when I click a button on form2, frmMain's text will
change to XXXX. Things are getting diffrent from vb6!

Regards,
Stanley

Nov 21 '05 #1
12 1253
"Stanley" <xs******@gmail.com> schrieb
Hi all! Supppose I one main form (frmMain), and another one (form2).
All I want to do is that, when I click a button on frmMain, form2
will show up, and then when I click a button on form2, frmMain's
text will change to XXXX.
Form2 is shown modally: Overwrite Showdialog (or add your own function)
returning the value to be displayed in frmMain. Think the OOP way: Define
the purpose and the INs and OUTs and don't care about the environment. Form2
will be usable everywhere no matter who called it.

Form2 is shown modeless: Raise an event and pass the value. Catch it - the
event and the value - in frmMain and use it.
Things are getting diffrent from vb6!


Yes, finally!

Armin
Nov 21 '05 #2
Stanley,

If you start form2 from form1 than the only thing you have to do is to tell
before the show

dim frm2 as new form2
frm2.owner = me

Than you can use in form2 something as
me.owner.label1.text = XXXXX

I hope this helps,

Cor
Nov 21 '05 #3
Thanks Armin, I want to show up form2 modelessly. You said I can raise
an event and pass the value, but I don't know how to do that! Suppose I
have a text box and a button in form2, each time the button is press,
frmMain's ListView will add 1 item with the text of form2's text box!
Hope you got me, and solve my problem. Many many thanks!

Nov 21 '05 #4
Thanks Cor, but I don't seem to have "me.owner.label1.text" even I have
set frmMain's label1's Modifies to "Public"! Thanks! Working with forms
in VB.Net really get me down!!

Nov 21 '05 #5
Thanks Cor, but I don't seem to have "me.owner.label1.text" even I have
set frmMain's label1's Modifies to "Public"! Thanks! Working with forms
in VB.Net really get me down!!

Nov 21 '05 #6
Thanks Cor, but I don't seem to have "me.owner.label1.text" even I have
set frmMain's label1's Modifies to "Public"! Thanks! Working with forms
in VB.Net really get me down!!

Nov 21 '05 #7
"Cor Ligthert" <no************@planet.nl> schrieb
Stanley,

If you start form2 from form1 than the only thing you have to do is
to tell before the show

dim frm2 as new form2
frm2.owner = me

Than you can use in form2 something as
me.owner.label1.text = XXXXX

Does with work with Option Strict Off? ;-)

Armin
Nov 21 '05 #8
Stanley,

Sorry I typed it direct in the message and forget that it has to be casted
to the type.

\\\in form2
DirectCast(Me.Owner, Form1).Label1.Text = "whatever"
///

This should do it.

Cor
Nov 21 '05 #9
"Stanley" <xs******@gmail.com> schrieb
Thanks Armin, I want to show up form2 modelessly. You said I can
raise an event and pass the value, but I don't know how to do that!
Suppose I have a text box and a button in form2, each time the
button is press, frmMain's ListView will add 1 item with the text of
form2's text box! Hope you got me, and solve my problem. Many many
thanks!

http://msdn.microsoft.com/library/en...nheritance.asp

same available via <F1>

Armin

Nov 21 '05 #10
Armin,
me.owner.label1.text = XXXXX


Does with work with Option Strict Off? ;-)


I have nocked me against my head enough, not needed that you do it extra.

:-)

Cor
Nov 21 '05 #11
"Stanley" <xs******@gmail.com> schrieb:
Supppose I one main form (frmMain), and another one (form2).
All I want to do is that, when I click a button on frmMain, form2 will
show up, and then when I click a button on form2, frmMain's text will
change to XXXX.


Providing a reference to an application's main form
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=accessmainform&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #12
Thank Armin, Wagner, and especailly Cor! I made it now! "DirectCast" is
what I really need!! I don't ever think that vb.net is so "cruel"!

Nov 21 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike | last post by:
I have just installed Visual Studio .NET and all necessary Windows Updates. I can open my project in the IDE without any problems and can run it without any problems. My PC's OS is Windows 2000...
6
by: Andrew V. Romero | last post by:
First off, I am mostly familier with PHP but am trying to make a multi-step javascript program. For an example, I would like to run different sections of the script depending on how many times the...
4
by: Ed | last post by:
Does anyone know of a way to create a complex multi column form (like the ones that can be created in programs like MS-Access)? This is for a secure WAN where all users will be using MS Internet...
3
by: Terri | last post by:
Hi, I'm using the following code to build a concatenated string from a multi-select combo. For Each varItem In Forms!frmreports!Combo1.ItemsSelected strSQL = strSQL &...
4
by: MSD | last post by:
I am running a report that uses a query as its record source and opens a form collecting beginning and ending item numbers to feed to the query. This works, but now I'm trying to use the result of...
0
by: Stuart Norris | last post by:
Dear Group, I am attempting to write a "splash" and "status" Form using a second thread. I wish to use this Form to display status information to the user when I do CPU intensive work in my...
5
by: Shane Story | last post by:
I can seem to get the dimensions of a frame in a multiframe tiff. After selecting activeframe, the Width/Height is still really much larger than the page's actual dimensions. When I split a...
6
by: CindyH | last post by:
Hi Does anyone know how to create a multi column combo box from the same table? Thanks, Cindy
5
by: bobwansink | last post by:
Hi, I'm relatively new to programming and I would like to create a C++ multi user program. It's for a project for school. This means I will have to write a paper about the theory too. Does anyone...
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.