473,796 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Crazy Rich Text box

36 New Member
Hi,

I have problem with rich text box, sometimes when form open and rich text have Text ... All text was Align to left and let white space (Click Her to show false ImageShack - Image Hosting :: trueqd2.jpg )
But when I click at the rich text box nothing of this problem happen?? (Click here to show true ImageShack - Image Hosting :: falseig1.jpg )


Thanx in advance .... :)
Dec 21 '08 #1
16 6477
MarwaAlSagheer
36 New Member
I mean that All text was Indent to left .

Any Help please ?
Dec 21 '08 #2
tlhintoq
3,525 Recognized Expert Specialist
Can you provide the code you are using to create the TextBox, along with the code for putting the text into the box?

While I don't read the language in the images I can see that each line starts exactly the same in both photos. That seems odd because of this was just a case of the text being indented the text should have wrapped, making the following lines start at different places in the text.

I also notice that the second box appears as if the text is "slipping under" the vertical slider. Is that slider really part of the TextBox or is it separate control you have tied to the textbox?

Of course if the problem only happens with the RichTextBox isn't clicked on (doesn't have focus) then you could assign focus to the RIchTextBox when the form is done loading. That isn't really a fix for the cause, its just a bandage for the symptom.
Dec 22 '08 #3
MarwaAlSagheer
36 New Member
Can you provide the code you are using to create the Textbox ?

There is no Specific code using to create Rich Textbox just drag and drop from toolbox.

Code for putting the text into the box?
Expand|Select|Wrap|Line Numbers
  1.  
  2.   Rchtxt_Motons.Text += "\n"+"الــمـتـن:" + "\t\t" + "\n";
  3.             Rchtxt_Motons.SelectionStart = 0;
  4.             Rchtxt_Motons.SelectionLength = 13;
  5.             Rchtxt_Motons.SelectionColor = Color.Maroon;
  6.             //***
  7.             if (Bite == string.Empty)
  8.             {
  9.                 Rchtxt_Motons.Text = Rchtxt_Motons.Text + "********:"+ "\n";
  10.             }
  11.             else
  12.             {
  13.                 Rchtxt_Motons.Text +=  Bite + "\n";
  14.             }
  15.             Bite = Rchtxt_Motons.Text;
  16.             //*********Colred Motons Text
  17.             Rchtxt_Motons.SelectionStart = 13;
  18.             Rchtxt_Motons.SelectionLength = Bite.Length;
  19.             Rchtxt_Motons.SelectionColor = Color.Black;
  20.             #endregion
  21.  
  22.             #region Description
  23.             //**Add Description           
  24.             string desctxt = "\n";
  25.             if (FlageBook == 'E')
  26.                 desctxt += "********:";
  27.             if (FlageBook == 'R')
  28.                 desctxt +="********:";
  29.             if (FlageBook == 'S')
  30.                 desctxt +="********:";
  31.             if (FlageBook == 'W')
  32.                 desctxt +="********:";
  33.             desctxt = desctxt + "\t\t" + "\n";
  34.             if (MatnDesc == string.Empty)
  35.                 MatnDesc += "********:";
  36.             Rchtxt_Motons.AppendText(desctxt + "\t\t" + "\n" + MatnDesc);//**Description
  37.             MatnDesc = desctxt + "\t\t" + "\n" + MatnDesc;
  38.             Rchtxt_Motons.SelectionStart =Bite.Length+desctxt.Length;
  39.             Rchtxt_Motons.SelectionLength = MatnDesc.Length;
  40.             Rchtxt_Motons.SelectionColor = Color.Black;
  41.              #endregion
  42.             return Rchtxt_Motons;
  43.  

this is the same code used to fill rich text box but not at loading form and problem doesn't happen .

Problem as you Say Text was indented

Is that slider really part of the TextBox or is it separate control you have tied to the textbox?

yes it is, i think it is not related to solve problem .

i try to set Focus , but problem still exist .
Dec 22 '08 #4
tlhintoq
3,525 Recognized Expert Specialist
Looks like you are adding two tabs at the end of every line. That would be the white space to the right of your text.

\t is a tab
\n is a new line

So line 36 for example builds a line of text then appends 'desctext' plus two tabs plus a newline.
Dec 22 '08 #5
MarwaAlSagheer
36 New Member
No this is not the problem, because i say that this is the same code to fill richtextbox but not at loading form and problem doesn't happen.

How it would be the problem while it was disappear when i click enter rich textbox ؟

To be sure i try to delete \t and problem still exist,
Dec 22 '08 #6
tlhintoq
3,525 Recognized Expert Specialist
In the RichTextBox, after you have gotten an indented block of text...
Select an entire line including the indented white space, and choose 'Copy'
Then paste that selected text into a text editor or MSWord and see what the whitespace characters really are.

I am a little lost in understanding the two different conditions; one that produces a problem and one that doesn't. Please tell me if I am understanding you correctly.

You have a form with a richtext box.
The form and the richtextbox are built at design time, not being added programmaticall y.

If you create the form and add text to the richtext box BEFORE showing the form it breaks.
If you create the form, show the form, then add the text it does not break.

Does that sound right?

Could you show the two blocks of code that do this?
One block where it breaks and one block where it doesn't?
Dec 22 '08 #7
MarwaAlSagheer
36 New Member
I try to select all text and paste it at text editor and there is no whitespace characters appear.

Does that sound right? Yes it does

And the point is code of two cases was the same .which I was post it before.
Dec 23 '08 #8
tlhintoq
3,525 Recognized Expert Specialist
@MarwaAlSagheer
If you can't select the white space then perhaps the problem is a little different than you first thought. Maybe the textbox LOCATION isn't where you are expecting it to be. Maybe the text is moved to the left because the textbox itself is moved to the left for some reason.
Dec 23 '08 #9
MarwaAlSagheer
36 New Member
No, textbox LOCATION doesn't change.

This white space disappears after mouce click at richtextbox.
in the case of add text to the rich text box BEFORE showing the form .

But in the case of show the form, then add the text it does not break there is no white space at rich textbox.
Dec 24 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
8697
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo field in plain text. That's because I truncate the string text but if, when I truncate it there's a rich tag the code following the truncated string is corrupted. Don't know if it's clear enough.
1
7774
by: PC User | last post by:
I found this Rich Text Editor and I've been trying to recreate it in my own application. I've had trouble with the COMCTL.ImageListCtrl and the COMCTL.Toolbar to recreate the toolbar. And I've had trouble with COMCTL.SBarCtrl in recreating the status bar. Does anyone have any experience with these or know of any website that explaines how to use these? http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=5545 ...
1
3415
by: Peter | last post by:
I have written a small terminal app that reads and writes to the serial port. In particular as the data is read from the serial port it is appended to the rich text box. The problem I am experiencing is this: When CrLf is received in the same read and appended to the rich text box, it processes it by moving to the beginning of the next line. This is right. When Cr is received at the end of one read it is appended to the rich text box....
0
2454
by: ray well | last post by:
hi, my app has two parallel rich text boxes containing the same content in 2 different languages. the lines parallel each other, line #3 in english contains the same content as line #3 in french. i need the two boxes to syncronize, if someone scrolls and clicks on line 23 in the english side, it should scroll to line 23 in the french side, and the same from french to english.
1
11773
by: tomi.trescak | last post by:
Hi I have a problem with storing rich text in MySQL. I store rich text in MySQL (in column with type "text") which i get from Rich Textbox control. When i do reverse processing by trying to fill rich text back to rich techbox (i set correct property "Rtf") i get whole text like: { tf1ansiansicpg1250deff0deflang1029{fonttbl{f0fnilfcharset0
9
8307
by: Neil | last post by:
I need to implement a rich text box in an MDB file for a user base that consists of Access 2000 and Access 2002. Unfortunately, I'm using Access 2003 on my development machine. My understanding is that because of security issues, the Microsoft Rich Textbox Control doesn't work in Access 2003. Thus, I'm left with 3 options: 1) Downgrade my development machine to Access 2002 (if I could even find a copy somewhere). 2) Upgrade all...
5
5371
by: ARC | last post by:
Just found out something interesting with Access 2007... In table design, if you set a memo field to the new rich text option, and put that control on a form, set the control to rich text, you can only use the text formatting menus IF the control is on a parent form! If the control is placed on a form that is a subform, the mini format toolbar, and the access toolbar will not work! However, if you place the control on a self-contained...
4
5485
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available in versions 3.0 or later of the class. However, also just found out that the new Rich Text property in Access 2007 ALSO does not support full text justification! This seems incredible, that MS would create a brand new application, and not...
16
11137
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might know one way or the other whether that was true or not, or could point me to an article or help text that would. What I have seen so far online and in Access 2007 help seems to confirm the above. But that (or at least (b)) seems incredible that it...
0
9685
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10461
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10239
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10019
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9057
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5447
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4122
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
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.