I know that I can call a procedure of Form1 from Form2 ?
But I don't know how, because I am a beginner.
Can anybody tell me please ?
Thanks in advance. 6 1117
"Joachim" <Jo*****@discussions.microsoft.com> schrieb "Joachim" <Jo*****@discussions.microsoft.com> schrieb I know that I can call a procedure of Form1 from Form2 ? But I don't know how, because I am a beginner. Can anybody tell me please ? http://msdn.microsoft.com/library/en-us/vb cn7/html/vbconProgramming WithObjects.asp
especiall sub topic http://msdn.microsoft.com/ library/en-us/vbcn7/html/ vaconPerformingActionsWithMethods.asp
Thanks for your reply Armin,
But I want is just simple.
I have a procedure in Form1, let's say : CountingNet() I want to call this procedure from Form2. So, what I have to do ? I have tried with (in Form1) : -Public sub CountingNet() -Shared sub CountingNet() -etx.. And in Form2 : Imports MyProject.Form1
But it didn't work.
Please tell me how to code it in VB.Net !
There are several ways depending on the situation. One is:
Form2:
private m_Form1 as form1
public sub new(byval Form1 as Form1)
myclass.new
m_form1 = form1
end sub
I assume you are creating Form2 within Form1:
In Form1:
dim f as form2
f = new form2(me)
f.show
Within Form2, you can now access Form1:
m_form1.CountingNet
In general, I prefer not to access a form in order to make the other class
(Form2) more abstract, so it can be also used in other situations.
--
Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
I do not create Form2 from Form1.
Actually Form1 is MDIParent and the Form2 is MDIChild.
So, I want to call a procedure that belong to Parent form from Child.
Joachim.
"Armin Zingler" wrote: There are several ways depending on the situation. One is:
Form2: private m_Form1 as form1 public sub new(byval Form1 as Form1) myclass.new m_form1 = form1 end sub
I assume you are creating Form2 within Form1: In Form1: dim f as form2 f = new form2(me) f.show
Within Form2, you can now access Form1: m_form1.CountingNet
In general, I prefer not to access a form in order to make the other class (Form2) more abstract, so it can be also used in other situations.
-- Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
Hi Armin,
Thanks A lot.
This is what I need.
Now my program works correctly.
Regards,
Joachim.
"Armin Zingler" wrote: "Joachim" <Jo*****@discussions.microsoft.com> schrieb I do not create Form2 from Form1. Actually Form1 is MDIParent and the Form2 is MDIChild. So, I want to call a procedure that belong to Parent form from Child.
directcast(me.mdiparent, form1).member
-- Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: dw |
last post by:
Hello all, I'm having a dickens of a time calling a stored procedure on a
connection. Every time I do, it generates an error "Arguments are of the
wrong type, are out of acceptable range, or are in...
|
by: Earl |
last post by:
If calling an exe that accesses a database from an ASP
page, does the Provider string to connect to the database
from inside the exe need to have the user as
being "IUSR..." or something since it...
|
by: Jarrod Morrison |
last post by:
Hi All
I was wondering if there is a way to call a stored procedure from inside
another stored procedure. So for example my first procedure will call a
second stored procedure which when...
|
by: randy.p.ho |
last post by:
Using JDBC, is there a way to call a stored procedure with multiple
return values? Thanks.
|
by: Tim Marshall |
last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down
code at the end of the post:
A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens
it. There are several...
|
by: singlal |
last post by:
Hi, my question was not getting any attention because it moved to 2nd
page; so posting it again. Sorry for any inconvenience but I need to
get it resolved fast. Need your help!
...
|
by: Jack |
last post by:
Hi,
I am trying to run an example code from a book. However I am getting the
following error message:
Number: -2147217900
Description: Syntax error or access violation
Source: Microsoft OLE...
|
by: eighthman11 |
last post by:
I'm calling a stored procedure on a sql server from an access
application. I just need the stored procedure to run I do not need any
data returned from the stored procedure to my Access...
|
by: amgupta8 |
last post by:
Note: This problem occurred when I updated the JDK from 1.3.1 to 1.4.1 or 1.4.2.
Nothing else was changed in the code, other than updating the JDK on the database server (dbm cfg parm jdk_path) and...
|
by: Soniad |
last post by:
Hello,
I am excecuting a stored procedure in my ASP page , it has one out parameter (@confirm) . after executing the procedure i want to retreive this out parameter and assign it to variable...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
| |