Welcome to Dream.In.Code
Become a C# Expert!

Join 150,390 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,069 people online right now. Registration is fast and FREE... Join Now!




How can i get focus on a richtextbox from other form

 
Reply to this topicStart new topic

How can i get focus on a richtextbox from other form

access2reality
29 Feb, 2008 - 09:47 AM
Post #1

New D.I.C Head
*

Joined: 10 Feb, 2008
Posts: 24


My Contributions
Hi,
I have problem in my application (my messanger) about smaily form .
in pm form i have a buttom for smaily and if user click on that it open a form whit smaily pic that user can select (i did try breakpoint and i know that code coming from smaily form to pm form ) but in pm form i can't put smaily code in richtextbox where user type his/her text and smaily .
this is my code and if you have any other quastion just let me know .

this is code of the class which read smaily code (when user select a smaily) i write this class in smaily form :

CODE

        public class Position
        {
            public int X = 0;
            public int Y = 0;
        }
        public Position pos = new Position();
        public void SetPosition(int x, int y)
        {
            pos.Y = x;
            pos.X = y;
        }
        public void HideMe()
        {
            this.Hide();
        }


and this is a smaily code :
CODE

            PM m = new PM();
            m.AddSmily(";)");
            HideMe();

and this is the code for append smaily code to richtextbox (it work in breakpoint and i have smaily code in a string code like wink2.gif )
i wirte this code in pm form :

CODE

        public void AddSmily(string code)
        {
            
            richTextBox1.AppendText(code);
            
        }


the problem is in runtime it doesn't work (i don't have any error it just doen't do anything)
User is offlineProfile CardPM
+Quote Post

access2reality
RE: How Can I Get Focus On A Richtextbox From Other Form
1 Mar, 2008 - 02:04 PM
Post #2

New D.I.C Head
*

Joined: 10 Feb, 2008
Posts: 24


My Contributions
Hi,
Any help over here?
thanks

This post has been edited by PsychoCoder: 1 Mar, 2008 - 02:16 PM
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: How Can I Get Focus On A Richtextbox From Other Form
1 Mar, 2008 - 02:18 PM
Post #3

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
access2reality,

Sometimes you have to show some patience. As you probably know most of us have very full lives, with work, school, families and such. Given that it can, at times, take time to get a reply, we don't just sit here waiting for someone to ask a question. So be a little patient and we will do what we can when we have the spare time to help. smile.gif
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 05:33PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month