473,403 Members | 2,359 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,403 software developers and data experts.

how to access objects in one form via a different one

hi,

i am making a word processor. i have the main form and my own version of the
character map in another. the main form has a rich textbox in it. my aim is
for the user to click on a character in the character map and that character
will appear in the main form's richtextbox.

i hope my question was understandable. if not, feel free to ask any
questions about this question

thanks in advance

whoops, gotta go pick up my son!
--
Alvo von Cossel I of Germany
Nov 17 '05 #1
3 1180
Hi Alvo,

Just create a public variable (a read only property would be a better
design) in your character map form and assign the selected character to it
so that you can access it from the word processor form:

// *** IN WORD PROCESSOR FORM
// launch Character Map form
FormCharacterMap cm = new FormCharacterMap();
if (cm.ShowDialog() == DialogResult.Ok)
{
char ch = cm.SelectedCharacter;
}

// *** IN CHAR MAP FORM
public char SelectedCharacter;
// assign value to this var whenerver the user selects a char...

Regards - Octavio
"Alvo von Cossel I" <Al************@discussions.microsoft.com> escribió en
el mensaje news:97**********************************@microsof t.com...
hi,

i am making a word processor. i have the main form and my own version of
the
character map in another. the main form has a rich textbox in it. my aim
is
for the user to click on a character in the character map and that
character
will appear in the main form's richtextbox.

i hope my question was understandable. if not, feel free to ask any
questions about this question

thanks in advance

whoops, gotta go pick up my son!
--
Alvo von Cossel I of Germany

Nov 17 '05 #2
hi there,

i just realised that i didnt even ask the question! sorry! here it is:

how do i access the main form's (Form1) richtextbox?

i just need to know that. the rest wont be a challenge unless any of you
dudes know from experience that it is a pain in the backside
--
Alvo von Cossel I of Germany
"Alvo von Cossel I" wrote:
hi,

i am making a word processor. i have the main form and my own version of the
character map in another. the main form has a rich textbox in it. my aim is
for the user to click on a character in the character map and that character
will appear in the main form's richtextbox.

i hope my question was understandable. if not, feel free to ask any
questions about this question

thanks in advance

whoops, gotta go pick up my son!
--
Alvo von Cossel I of Germany

Nov 17 '05 #3
Alvo,

Rewrite your Main() method so that instead of:

public static void Main()
{
Application.Run(new MainForm());
}

it says:

public static MainForm AppMainForm;

public static void Main()
{
AppMainForm = new MainForm();
Application.Run(AppMainForm);
}

After that, you'll be able to refer to your main form from any other form or
class using:

MainForm.AppMainForm

Regards - Octavio
"Alvo von Cossel I" <Al************@discussions.microsoft.com> escribió en
el mensaje news:63**********************************@microsof t.com...
hi there,

i just realised that i didnt even ask the question! sorry! here it is:

how do i access the main form's (Form1) richtextbox?

i just need to know that. the rest wont be a challenge unless any of you
dudes know from experience that it is a pain in the backside
--
Alvo von Cossel I of Germany
"Alvo von Cossel I" wrote:
hi,

i am making a word processor. i have the main form and my own version of
the
character map in another. the main form has a rich textbox in it. my aim
is
for the user to click on a character in the character map and that
character
will appear in the main form's richtextbox.

i hope my question was understandable. if not, feel free to ask any
questions about this question

thanks in advance

whoops, gotta go pick up my son!
--
Alvo von Cossel I of Germany

Nov 17 '05 #4

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

Similar topics

6
by: Hamed | last post by:
Hello I have employed as a developer in a software company that its team uses FoxPro / VB 6.0 / VC++ 6.0 as the developing tools and newly is going to migrate to VS.NET. There is a project...
63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
20
by: John | last post by:
Hi, I've recently upgraded from Access 97 to Access 2002 & the performance basically stinks. I have tried the following items listed below but it has only had a minor impact: 1) Upgraded Jet...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
4
by: rufus | last post by:
Hi, On the project I am working on we need to encapsulate all data and business logic in an activex dll. My question is: How do I do this? How can I access the form objects ie text boxes,...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
55
by: AnandaSim | last post by:
I just had a google through this NG but have not seen mention of Erik Rucker's blog entry and the new Jet: http://blogs.msdn.com/access/archive/2005/10/05/477549.aspx mentioned by Mike...
3
by: Mr Newbie | last post by:
I am messing around with Web User Controls at present and (think) I have discovered the following. 1.) The identifier for the control in the code behind must match the ID for the control on the...
7
by: needin4mation | last post by:
Hi, I have an Access 2002 - 2003 database. I am using Access 2003. Whenever I link an image all it shows is the filename. Not the image. Other versions of Access can link the image just fine. ...
2
by: Michael Bialowas | last post by:
Hello all, I have been searching the net endlessly and found this ng, so I thought I would give a try. Anyways, I have a few problems I am trying to implement a combo box which presently contains...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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
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
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.