473,503 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MyDialog and MyClass.cs share a member

Hi,

I've created a windows form application. I have a form and a .cs file
in the application, and I've renamed them to MyDialog and MyClass.cs.

In MyClass.cs, I have a member called "Publisher" and I assign value
to this member in MyClass.cs.

In MyDialog (upon a button click), I'll need to use the current value
of "Publisher" from MyClass.cs. But I don't know how. Anyone can
help?

FYI, my code is below:

namespace MyNamespace
{
public class MyClass
{
string Publisher;

public MyClass()
{

Publisher = String.Format("_FTDIALOG_{0}",
TritonObjectManager.User.GetField("RTGRP").ToStrin g().ToUpper());

Logger.LogMessageBarMessage(ESeverity.Detail, "In MyClass --
Publisher: " + Publisher + "|");

}
}
}

namespace MyNamespace
{
public partial class MyDialog : Form
{
string Publisher;

public MyDialog()
{
InitializeComponent();
}

private void btExecute_Click(object sender, EventArgs e)
{

//Need to get the value of Publisher from MyClass here!
// How to use the current value of Publisher from MyClass?

Logger.LogMessageBarMessage(ESeverity.Detail, "In MyDialog --
Publisher: " + Publisher + "|");
}
}
}

Oct 9 '08 #1
0 1292

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

Similar topics

32
2685
by: Mario Fratelli | last post by:
MyClass *p = new MyClass; MyClass *p = new MyClass(); do they mean something different? Thanks a lot, Mario Fratelli.
1
1198
by: Dave | last post by:
Hello all, Below is an adaptation of an example Victor gave for testing compiler behavior with regard to the issue of the difference between new MyClass; and new MyClass();. I have included...
5
1613
by: modemer | last post by:
I saw someone use the following code: void func(MyClass *& myCls) { myCls->test(); } // call func(): func(new MyClass);
11
2488
by: modemer | last post by:
If I define the following codes: void f(const MyClass & in) {cout << "f(const)\n";} void f(MyClass in) {cout<<"f()\n";} MyClass myclass; f(myclass); Compiler complain that it can't find...
4
2393
by: John | last post by:
I have a function declaration that gives an error while compiling. Can anyone help me figure this one out? inline void create(const std::vector< myclass >& plist, std::vector< myclass...
24
3539
by: Water Cooler v2 | last post by:
What is the difference between the Me and the MyClass keywords? I understand Me that it represents the specific instance of the class. When you're inside the object instance, it refers to itself...
5
1869
by: tom | last post by:
Hi, I'm overriding my operator new and operator delete for two classes, one inherited from the other, so I can use my own memory pool. A simplified version of what I have is below: class...
6
2163
by: Immortal Nephi | last post by:
First class is the base class. It has two data: m_Base1 and m_Base2. Second class and third class are derived classes and they are derived from first class. m_Base1 and m_Base2 are inherited into...
2
5314
by: unauthorized | last post by:
The short story: I need to be able to cast a function pointer for any function and class to an intermediate type, so I could call it from any point of my program using the "__asm call" instruction....
0
7204
marktang
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,...
0
7282
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
7342
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...
1
6998
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
5586
agi2029
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,...
0
4680
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.