473,569 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to access the mainclass from a dialogBox or static class

Hi,

I wonder how to get the mainwindow from a dialogbox or static class. Usually i use TopLevelControl (is that a good idea) to get the mainwindow from witch I can gain access to any subcontrols... But how to do this from a static for example? Should I "store" the mainwindow in my static class with a special function to access it later?

If someone sees what I mean (I know it's not easy because I don't really know how to explain it :s)

Thanks a lot!
Nov 16 '05 #1
0 928

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

Similar topics

11
2154
by: Noah Coad [MVP .NET/C#] | last post by:
How do you make a member of a class mandatory to override with a _new_ definition? For example, when inheriting from System.Collections.CollectionBase, you are required to implement certain methods, such as public void Add(MyClass c). How can I enforce the same behavior (of requiring to implement a member with a new return type in an...
6
2431
by: Christian H | last post by:
Hi! I've created a custom control (myDrawControl) that deals with drawing. This control is then added to a form( myMainForm) Now, whenever something is dragged and dropped onto myDrawControl , I want to update a variable in myMainForm that keeps track of the objects that have been added.(ArrayList objectsAdded) Now I'm a little...
6
3576
by: z_learning_tester | last post by:
Quick question- What happens if you have a private class with a public static method? Can you still say the following? Lets say you are making this call from another class, say class2... int myVal = class1.method(); It seems that you should not be able to, after all from class2, you should not be able to see the private class1, so it's...
0
1036
by: Baramuse | last post by:
Hi, I wonder how to get the mainwindow from a dialogbox or static class. Usually i use TopLevelControl (is that a good idea) to get the mainwindow from witch I can gain access to any subcontrols... But how to do this from a static for example? Should I "store" the mainwindow in my static class with a special function to access it later? If...
1
2696
by: Roy Gourgi | last post by:
Hi, I am using VS.NET 2003 and I have made a connection to a MS Access database using the Server Explorer. Is this connection permanent, meaning that it will be there every time I reopen my program. Furthermore, how do I add, delete, find, update a record? TIA Roy
1
1955
by: foreman | last post by:
Hello Everybody: I am trying out DialogBox, and I have been trying to press the OK Button on the dialogbox hoping I can receive the OK DialogResult to Main Form. Below is my OK button click event handler code on AboutBox Dialogbox: DialogResult = DialogResult::OK; It can also dismiss the dialogbox and return OK "Ideally".
3
2554
by: tom | last post by:
How to get access to veriable from static class member? class cTest { public: int a; void Set_a(){a = 1;} static int dlgTest()
6
1524
by: recherche | last post by:
Hi! Is the following program valid, although it compiles and executes successfully? // params modifier // used to declare array parameter // value type, no constructor using System;
3
1786
by: Sune | last post by:
Hi all, I'm not a C# programmer so please be gentle: Prereq: --------------- - The lookup service (see below) implemented by a C module cannot be re-written in C# ;-) - The lookup service is to be loaded into the process of the C# application, i.e. I want to avoid expensive IPC
0
7697
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7968
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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 we have to send another system

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.