| | |
two numbers in different alignment in one textbox(pls help)
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
•
•
Not even with an RTB but you could fake it.
Easiest way would be to use a mono spaced font like courier new and add the required number of spaces between the two sets of numbers.
Good Luck
I am talking about RTF option - TextRTF ; SelRTF etc..
Richtextbox is supported RTF.....
Here 2 year ago i created a program like that I used 2 RichTextBoxes for this one for one data and another for another data.And I used this code
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Command1_Click() rt1.SelRTF = rt2.TextRTF rt1.SelAlignment = vbRightJustify rt2.SelAlignment = vbLeftJustify End Sub Private Sub Form_Load() rt1.Text = "300" rt2.Text = "250" rt1.SelAlignment = vbRightJustify rt2.SelAlignment = vbLeftJustify End Sub
Here when you click that Command Button 1 then this will happen [ Look the Image I Posted here ....
•
•
•
•
I think you can add one more rich text else it will work correctly only for the first time .... Becoz in this if you clicked again and again it will come with new Number in Textbox 2 with the old number in Textbox 1 ...If you changed the value in first text box then everything will go wrong !!!
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Command1_Click() rt1.SelRTF = rt3.TextRTF rt1.SelRTF = rt2.TextRTF rt1.SelAlignment = vbRightJustify rt2.SelAlignment = vbLeftJustify rt3.SelAlignment = vbRightJustify End Sub Private Sub Form_Load() rt1.Text = "300" rt2.Text = "250" rt3.Text = "500" rt1.SelAlignment = vbRightJustify rt2.SelAlignment = vbLeftJustify rt3.SelAlignment = vbRightJustify End Sub Private Sub rt1_Change() rt1.SelAlignment = vbRightJustify rt2.SelAlignment = vbLeftJustify rt3.SelAlignment = vbRightJustify End Sub
Last edited by Vineeth K; Oct 3rd, 2009 at 1:32 pm.
Who wants to be a GOD ??
•
•
Join Date: Mar 2009
Posts: 835
Reputation:
Solved Threads: 153
Hmmm....
1. your example pic shows both left aligned
2. multiple controls (op said one)
3. example also shows RTB's with style of 3D which would put an artifact in the center of the two text areas. Style would need to be flat and if OP wanted to have that 3D border then OP would also have to contain the two text/rtb's within a picturebox (as it has the same/simular 3D border.
1. your example pic shows both left aligned
2. multiple controls (op said one)
3. example also shows RTB's with style of 3D which would put an artifact in the center of the two text areas. Style would need to be flat and if OP wanted to have that 3D border then OP would also have to contain the two text/rtb's within a picturebox (as it has the same/simular 3D border.
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
Hey please look at that image carefully there is one more text in right side ...and it is in right alignment .....And i used another text to get the second number which is in different alignment ....
The rich text box in bottom is just dummy ..In this post i added text with different alignment and different font into the one rich text box.
Like this you can show texts with different fonts in one rich text box.Just add a code to change the font of rich text box 2 and run the program you can see it .....
Try it ....
The rich text box in bottom is just dummy ..In this post i added text with different alignment and different font into the one rich text box.
•
•
•
•
Please run the code then there will be no doubts hehehehe ....
Here a new image . i marked text [ they are in different fonts and alignment...And all texts are in one rich text box ....!!!
Like this you can show texts with different fonts in one rich text box.Just add a code to change the font of rich text box 2 and run the program you can see it .....
Try it ....
Last edited by Vineeth K; Oct 3rd, 2009 at 4:33 pm.
Who wants to be a GOD ??
Yes but the first code will help you to bring those in one line the problem is after that it will not work ..............
Please carefully look at the first picture the first 2 numbers are in one line and their font is different too.But after that it will go wrong.
Or there is one method [ i never tested before ......] save that file when it become in one line as a rtf file .and load it when you need it ....hehehehe
We can bring those different alignment and fonts into one Rich text box.
Please carefully look at the first picture the first 2 numbers are in one line and their font is different too.But after that it will go wrong.
Or there is one method [ i never tested before ......] save that file when it become in one line as a rtf file .and load it when you need it ....hehehehe
We can bring those different alignment and fonts into one Rich text box.
Who wants to be a GOD ??
after a 24-7 coding of this thread.i still not get the right solution. I have decided to create an activex control, to put two textbox that is borderless then i will overlap their 2 edges to make it look one textbox.
I have not started to build this yet. But is this the closest solution to make this program running? If it is, please help me guys bring the future activex control for this?
Thank you guys for your time.!
I have not started to build this yet. But is this the closest solution to make this program running? If it is, please help me guys bring the future activex control for this?
Thank you guys for your time.!
Last edited by blocker; Oct 4th, 2009 at 10:04 pm.
I have not started to build this yet. But is this the closest solution to make this program running? If it is, please help me guys bring the future activex control for this?
hmmmmm .... In this case you can only do with coding is what i did [ there may\must be another way ....think boy ..........] .Else you are right can create an active x control.It will help you to use it again and again hehehe.
Or If you don't know to create an active x control then just add that 2 RTB into the form directly without borders ...hehehehe .....
If you want to use that only for the first time you can use the first code ...it will work.
hmmmmm .... In this case you can only do with coding is what i did [ there may\must be another way ....think boy ..........] .Else you are right can create an active x control.It will help you to use it again and again hehehe.
Or If you don't know to create an active x control then just add that 2 RTB into the form directly without borders ...hehehehe .....
•
•
•
•
And Remember If possible make that RTB's maximum long ..becoz if the number become big then it is easy to understand that you are using 2 boxes.Please restrict numbers up to a maximum size...
Who wants to be a GOD ??
•
•
•
•
I have not started to build this yet. But is this the closest solution to make this program running? If it is, please help me guys bring the future activex control for this?
hmmmmm .... In this case you can only do with coding is what i did [ there may\must be another way ....think boy ..........] .Else you are right can create an active x control.It will help you to use it again and again hehehe.
Or If you don't know to create an active x control then just add that 2 RTB into the form directly without borders ...hehehehe .....
If you want to use that only for the first time you can use the first code ...it will work.
but the use of two textbox in a form is hard to bind in any grid. In this case activex control wiil solve this problem. thank you very much guys. If you are willing to help me build the active x then thank you again?..hehehe
Last edited by blocker; Oct 5th, 2009 at 6:01 am.
![]() |
Similar Threads
- Finding words in a text (C#)
- how to convert words to numerals (C#)
- How to display the data returned by select statement in a TextBox (C#)
- Can I get a simple php code to measure how many words per minute someone can type? (PHP)
- Need Help To Make First Letter Of All Words In A Textbox To Uppercase (Visual Basic 4 / 5 / 6)
- displaying data from database to textbox (ASP.NET)
- Generating words in random letters in a 5x5 dimension textboxes (Visual Basic 4 / 5 / 6)
- Print into a control (wxPython) (Python)
- Im Now A Master Poster! (IT Professionals' Lounge)
- How to get auto calculated expiry date on lost focus event of registration date (ASP.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





