Re: Understanding Public Module or Class
- From: Rudy <Rudy@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Sep 2006 09:31:02 -0700
Thanks Kevin and Cor for the great info. I found the information very
interesting and give me a better idea of what to use.
Thanks again!
Rudy
"Cor Ligthert [MVP]" wrote:
Rudy,.
These three are almost the same
VB.Net
\\\
Module MyModule
Public myPublic as String
End module
///
Class MyModule
Public shared myPublic as String
End Class
////
The difference is in this that you can use with a module the myPublic
without calling the module (The later is possible as well and much nicer but
this is not a VB.Net newsgroup)
C#
\\\
Class MyModule
{public static string myPublic;}
///
The last two are exact the same.
Although this is an example; in all three I would use properties and private
members instead of the public as it is showed now.
I hope this gives an idea,
Cor
"Rudy" <Rudy@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:A821B16D-6C38-4F71-BF58-58756293E1AA@xxxxxxxxxxxxxxxx
Hello All!
I'm a little confused on Public Class or Modules.
Say I have a this on form "A"
Public Sub Subtract()
Dim Invoice As Decimal
Dim Wage As Decimal
Static PO As Decimal
Invoice = CDec(txbInv.Text)
Wage = CDec(txbTotWage.Text)
PO = Invoice - Wage
txbPO.Text = PO.ToString.Format(PO)
End Sub
So I know I can call this up anywhere within that form. But now I need to
use this in form "b". The textboxes are in place in form "b", same name
and
everything else. So a couple of things about this. First, will I run into
problems if I have textboxes named the same in two diffrent forms? Would I
use a public Class, or Module. I guess I don't understand the diffrence.
And
I would I call up this in Form "B"?
TIA!!!
Rudy
- References:
- Re: Understanding Public Module or Class
- From: Cor Ligthert [MVP]
- Re: Understanding Public Module or Class
- Prev by Date: Threading in a form...
- Next by Date: Visual Foxpro - ODBC from Business objects
- Previous by thread: Re: Understanding Public Module or Class
- Next by thread: How to set custom report size in vb .net?
- Index(es):
Relevant Pages
|