How can I write left and right in the same line of a richtextbox?

I want to write, in the same line, text with a right aligment and other with left aligment. How can I do it?
thanks

I want to write, in the same line, text with a right aligment and other with left aligment. How can I do it?
thanks
As
Viorel_ says "Perhaps there are other much easier solutions. For example, create two
RichTextBoxes with no borders (if you only need two columns of text)" but the real issue would be saving the info in the RichTextBox's (RTB's) RTF or Text to two different RTF or TextFiles. Although I suppose if it was just going to
a TextFile then you could somehow use a delimited text file so each same line number of each RTB is appended to the same line and delimited. That way you could probably load a split array with each line from the text file splitting on the delimeter per line
and providing RTB1 with index 0 of the split array and RTB2 with index 1 of the split array. I'm not going to try that.
This is some leftover code from a long time ago. It has three RTB's. RTB1 is there I suppose because the thread asking for this code wanted it. RTB2 is borderless as well as RTB3. The Aqua control in the top image below is the Panel used to cover RTB2's
scrollbar. So RTB3's scrollbar is used to scroll both controls.
I forgot to test if I typed past the scroll position in RTB2 if both would scroll as maybe RTB3 would not since it would not have anything to scroll to I suppose.
Maybe this code can help or maybe not. The bottom two images are the app running and displaying nothing scrolled in RTB2 and RTB3 then the scroll used in the bottom image.
Disregard the commented out code in the code below. It was there so I left it there. I suppose you should delete it. Also I didn't set the RTB's so one was left aligned and the other right aligned. I believe the Panel becomes a control in RTB2's controls
when it is moved to cover RTB2's vertical scrollbar but don't remember although that seems the case since both RTB2 and RTB3 are brought to front so if the Panel was not one of RTB2's controls I would think it would be behind RTB2 and RTB2's vertical scrollbar
would display but don't remember now. In fact I don't really remember how that part works. :)
Option Strict On
Public Class Form1
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByRef lParam As Point) As Integer
Const WM_USER As Integer = &H400
Const EM_GETSCROLLPOS As Integer = WM_USER + 221
Const EM_SETSCROLLPOS As Integer = WM_USER + 222
Dim FixTheProblem As New List(Of String)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.CenterToScreen()
Panel1.BackColor = Color.White
Panel1.BorderStyle = BorderStyle.Fixed3D
RichTextBox2.BorderStyle = BorderStyle.None
RichTextBox2.ScrollBars = RichTextBoxScrollBars.Vertical
RichTextBox3.BorderStyle = BorderStyle.None
RichTextBox3.ScrollBars = RichTextBoxScrollBars.Vertical
RichTextBox3.Size = RichTextBox2.Size
RichTextBox3.Top = RichTextBox2.Top
RichTextBox3.Left = RichTextBox2.Right - 20
Panel1.Size = New Size(RichTextBox2.Width * 2 - 16, RichTextBox2.Height + 4)
Panel1.Left = RichTextBox2.Left - 2
Panel1.Top = RichTextBox2.Top - 2
RichTextBox2.BringToFront()
RichTextBox3.BringToFront()
FixTheProblem.Add("Curry: £6.50")
FixTheProblem.Add("Mineral Water: £4.50")
FixTheProblem.Add("Crisp Packet: £3.60")
FixTheProblem.Add("Sweat Tea: £2.23")
FixTheProblem.Add("Motor Oil: £12.50")
FixTheProblem.Add("Coca Cola: £.75")
FixTheProblem.Add("Petrol Liter: £3.75")
FixTheProblem.Add("Shaved Ice: £.50")
FixTheProblem.Add("Marlboro: £2.20")
FixTheProblem.Add("Newspaper: £.25")
FixTheProblem.Add("Spice Pack: £.75")
FixTheProblem.Add("Salt: £.50")
FixTheProblem.Add("Pepper: £.30")
For Each Item In FixTheProblem
RichTextBox1.AppendText(Item & vbCrLf)
Next
RichTextBox1.SelectionStart = 0
RichTextBox1.ScrollToCaret()
Dim Fix As String = ""
For Each Item In FixTheProblem
Fix += Item.Replace(":", "^:") & vbCrLf
Next
Fix = Fix.Replace(vbCrLf, "^>")
Dim FixSplit() As String = Fix.Split("^"c)
For i = 0 To FixSplit.Count - 1
If CBool(i Mod 2 = 0) = True Then
RichTextBox2.AppendText(FixSplit(i).Replace(">"c, "") & vbCrLf)
ElseIf CBool(i Mod 2 = 0) = False Then
RichTextBox3.AppendText(FixSplit(i) & vbCrLf)
End If
Next
End Sub
Dim RTB2ScrollPoint As Point
Private Sub RichTextBox2_Vscroll(sender As Object, e As EventArgs) Handles RichTextBox2.VScroll
Dim RTB2ScrollPoint As Point
SendMessage(RichTextBox2.Handle, EM_GETSCROLLPOS, 0, RTB2ScrollPoint)
SendMessage(RichTextBox3.Handle, EM_SETSCROLLPOS, 0, New Point(RTB2ScrollPoint.X, RTB2ScrollPoint.Y))
'Me.Text = RTB2ScrollPoint.X.ToString & " .. " & RTB2ScrollPoint.Y.ToString
End Sub
Private Sub RichTextBox3_Vscroll(sender As Object, e As EventArgs) Handles RichTextBox3.VScroll
Dim RTB3ScrollPoint As Point
SendMessage(RichTextBox3.Handle, EM_GETSCROLLPOS, 0, RTB3ScrollPoint)
SendMessage(RichTextBox2.Handle, EM_SETSCROLLPOS, 0, New Point(RTB3ScrollPoint.X, RTB3ScrollPoint.Y))
'SendMessage(RichTextBox2.Handle, EM_SETSCROLLPOS, 0, New Point(0, 10))
End Sub
End Class
La vida loca

Similar Messages

  • How can I separate Left and right audio channels in labview 8.5 tia sal22

    How can I separate Left and right audio channels in labview
    8.5 tia sal22
    Greetings All
    I have a working Labview vi that converts a math formula to an
    audio signal.  I would like to have the
    right and left audio channels playing different math audio signals is this
    possible?
    Example
    Right channel -> plays the audio signal created by a math
    formula
    Left channel -> plays the audio signal created by another
    math formula with adjustable phase control
    I’ve included a VI with a working audio and math formula but
    I’m not sure how to separate the left and right channels.
    I’m using labview 8.5
    I looked up a similar question on the
    support board and it said” use an instance of the the Sound Output Write that
    has a 1D waveform data type input (i.e.  Sound Output Write (DBL)). Each
    element in the array would correspond to a channel.”
    But I’m not exactly sure what he meant.  I’m using a formula to generate the wave file
    Tia sal22
    Attachments:
    fixed mathscript formula to sound test.vi ‏680 KB

    Sorry it took so long to get back.  Here's the new VI with it splitting out the left and right channels. 
    I'm using a Gigaport HD 8 output usb audio device but I'm experience clicks and pops.  I increase the buffers
    but I still get the clicks and pops.  I know gigaport HD can use ASIO drivers which most likely would solve the problem but one needs to code in C for this which I'm not proficient in.  Can someone recommend a work around to prevent this clicks and pops, can I somehow change my VI to fix this? Does anyone have a VI that will allow access to the ASIO latency properties?
    I'm using labview 8.5
    And a gigaport HD which is a USB audio device which outputs 8 analog signals (it is ASIO compatible)
    tia sal22
    Attachments:
    lvt_audio_realtime-out left right device ID test.vi ‏68 KB

  • How can I combine Left and Right audio?

    Hi,
    When I record video, one lapel mic records to the left channel and the other records to the right channel in one audio track. I can't seem to figure out how to combine them within Premiere Pro (I've already attempted searching the forums for more info). I know in Sony Vegas you can right click the single audio track and select "Combine" and it will combine the 2 channels so that when people watch the end product you have both voices coming out of both speakers.
    Any help would be appreciated.
    Thanks
    Kelly G.

    Hello,
    Yes i have the same issue.
    I use the duplicate Audio track and fill left and right all the time.
    when i am doing Interview videos i usually have one person on channel 1 and the other on channel 2 and it comes out as L and R in Premiere.
    Today i was shooting with myself on Channel 2 and a shotgun for some ambient sound on channel 1.
    In Vegas or FCP 7 there is a simple effect to drag and drop called " Combine" that nicely combines the L and R channels each into stereo.
    I used to use it quite a bit and think it would be a great addition to Premiere Pro.
    So i am wondering several years since this was first post if Premiere does in fact now have this option...and where it might be that i over looked it?
    If not.....is there an easier way to do this than the fill left and right method?
    Thanks so Much!
    Mark

  • How can I keep left- and right-aligned paragraphs together on the same line?

    I am currently trying to typeset a menu. Basically, I want the Dish Title to be left-aligned and the Price right-aligned — but on the same line. I can achieve the effect by typing in a shift+tab after the Dish Title text and then inserting the price, but I would rather have two distinct paragraphs styles, so that I can adjust them globally to see what looks good. I can achieve the effect by adjusting the Price character baseline of the price and moving it up, but then if I need to make any price changes, I find it a pain trying to get the cursor in the right place in situations where a baseline is substantially altered.
    Back in the old days (in Ventura!!), I could just remove the line break after the "Dish Title" style and the "Price" would move up to the same line, but I can't seem to be able to do this in CS6.
    Any ideas?

    Please show some examples. It's easier to help you.
    If I understand right, use a paragraph style with a right aligned tab and nested styles and grep styles. That's extremly flexible.
    Have fun

  • How can I place multiple choice boxes on the same line instead of in a column?

    I know it is possible to place multiple fields on the same line, using drag and drop.
    But to save space, I would like to have 3 or 4 multiple choice boxes next to each other on one line. 
    Is this possible, and if so, how?
    Thanks
    Peter

    You may click on the "+" button to the right of the first multiple choice box to add more in the same line. When you hover over the button, the tooltip says "insert item beside".

  • How can i give multiple paragraph styles on the same line

    i want to give different paragraph style in the same line in an indesign document. bt when i tried it, it is coming in two different line.
    actually i am doing a project in which Frame maker document is transformed into indesign document. in frame maker this is possiable, but in indesign i cannot give different paragraph style in the same line of the document.
    Is there any way to do this ????

    YaneshTyagi wrote:
    i want to give different paragraph style in the same line in an indesign document. bt when i tried it, it is coming in two different line.
    actually i am doing a project in which Frame maker document is transformed into indesign document. in frame maker this is possiable, but in indesign i cannot give different paragraph style in the same line of the document.
    Is there any way to do this ????
    Hi, Yanesh:
    Please understand, the FrameMaker feature known as a run-in paragraph, which is a paragraph with a "carriage return" but without a "line feed," HAS NO COUNTERPART in InDesign. InDesign also lacks the FrameMaker side heading feature, which is created by the combination of a reserved area in the text frame and the paragraph property to inhabit that area. FrameMaker separates paragraphs by using the larger of space below paragraph and space above paragraph, but InDesign separates paragraphs by adding the space below paragraph and the space above paragraph.
    There are several complicated manual methods of simulating these FrameMaker properties in InDesign.
    Here's a recent forum discussion of these exact issues: http://forums.adobe.com/message/3759635#3759635. The thread mentions DTP Tools' conversion tool, the MIF Filter commercial plug-in for InDesign, and discusses its shortcomings. I don't recall it mentioning in-tools.com plug-ins that can simulate side headings, like those in FrameMaker, but they don't convert FrameMaker to InDesign. 
    You can add your vote for InDesign's developers to include these FrameMaker features, and any others you'd like to see, here: wish.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • How can I have podcasts and music in the same playlist in iOS7?

    How can I create an iTunes playlist that contains both music and podcasts and export that playlist to my iPhone? This was once possible. If you download the "Podcast" app, podcasts can still be added  to iTunes playlist which you can listen to on your Mac. But when you sync that playlist to iPhone, it will omit all of the podcasts.
    Previously, the workaround was not to download the Pocast app. That way, podcasts remained in iTunes where they could still exist in with music in the same playlist. But as of iOS7, you are required to install the "Podcasts" to be able listen to podcast at all. No more workaround.
    Why does this matter? Some people, like me want to drive or exercise while listening to a mix of music and podcasts. Apple's "improvements" have restricted the way that I am able to use iTunes.
    I can only think of these solutions:
    Convert the podcast into AAC or other format. Then iTunes sees it as "music" and it will stay in the playlist. Cons: 1. Burdensome. 2. Removes the resume feature from the podcast. 
    Use a different iPhone app. Spotify lets you drag any track (even podcasts) into a playlist and they stay there when synced to the Spotify iPhone app. Cons: 1. Requires Spotify premium service to listen to playlists on iPhone. 2. The resume feature is removed. 3. Very difficult to forward and rewind. 4. Some podcasts are rejected by the Spotify playlist, although its rare. 5. After being imported, the tracked need to be synced to the phone via WiFi (as with all tracks that are not offered via Spotify.)
    I am using the Spotify solution but am interested to know if there is an Apple solution. Or maybe I am the only one that wants to mix podcasts with music.

    How can I create an iTunes playlist that contains both music and podcasts and export that playlist to my iPhone? This was once possible. If you download the "Podcast" app, podcasts can still be added  to iTunes playlist which you can listen to on your Mac. But when you sync that playlist to iPhone, it will omit all of the podcasts.
    Previously, the workaround was not to download the Pocast app. That way, podcasts remained in iTunes where they could still exist in with music in the same playlist. But as of iOS7, you are required to install the "Podcasts" to be able listen to podcast at all. No more workaround.
    Why does this matter? Some people, like me want to drive or exercise while listening to a mix of music and podcasts. Apple's "improvements" have restricted the way that I am able to use iTunes.
    I can only think of these solutions:
    Convert the podcast into AAC or other format. Then iTunes sees it as "music" and it will stay in the playlist. Cons: 1. Burdensome. 2. Removes the resume feature from the podcast. 
    Use a different iPhone app. Spotify lets you drag any track (even podcasts) into a playlist and they stay there when synced to the Spotify iPhone app. Cons: 1. Requires Spotify premium service to listen to playlists on iPhone. 2. The resume feature is removed. 3. Very difficult to forward and rewind. 4. Some podcasts are rejected by the Spotify playlist, although its rare. 5. After being imported, the tracked need to be synced to the phone via WiFi (as with all tracks that are not offered via Spotify.)
    I am using the Spotify solution but am interested to know if there is an Apple solution. Or maybe I am the only one that wants to mix podcasts with music.

  • How can I make my user input on the same line as the question?

    The only way I know of doing it is
    System.out.println ("Please enter an uppercase letter of the English Alphabet: ");
              letter = dataIn.readLine ();But that makes Please enter an uppercase letter of the English Alphabet:
    **User input here, a line down**So how can I make it all fit into one line with this sort of layout:
    Please enter an uppercase letter of the English Alphabet:  **USER INPUTS HERE, SAME LINE**

    change your call from println to print.
    check the API docs for this stuff, it tells you everything you need to know.
    Good Luck
    Lee

  • How can I connect left and right RCA audio jacks to my iMac to record?

    I would like to connect my Tascam 8-track digital recorder to the iMac. The Tascam stereo output is L/R RCA jacks. Is there a chord that is Stereo L/R RCA male jacks on one end and a USB or Thunderbolt jack on the other side?
    Thanks much,
    John

    NYCteacherR wrote:
    I'm new to this this forum and new to Apple Computers. I hope you don't work for Apple as a moderator, because your attitude is sarcastic and unhelpful.
    So, I'll tell you what, don't bother responding to any of my posts in the future.
    None of us are moderators -- they seldom post anything but when they do you will know it because they have special avatars nobody else can use. As for the "unhelpful" remark, please read the "How to write a good question" info that appears on the page where you type the summary of your question. That explains the importance of including details in your summary -- without them we have no way of knowing what might be helpful & what would just waste our time & yours, or even cause you needless expense or problems with your Mac.
    Also, please be aware that even though you asked the question, in the future other users looking for similar answers may read this discussion, so by providing enough info for anyone to tell if what is discussed here is relevant to them, you can help other users too.

  • How can I use REQ1 and REQ2 at the same time to send two different groups of data to two blocks of buffers?

    I want to use REQ1 to send data1(16bits) in th rate of 10MHZ to buffer1 and REQ2 to send data2(16bits) in the rate of 1KHz to buffer2. The first part(sending data1) has been done(using the attached file).How to re-cofigure the ports to send data2 to buffer2?
    Attachments:
    DIsingleBufExtTrig653x.C ‏6 KB

    Greetings,
    Essentially, this is a matter of duplicating this code for use with the second group. However, be certain to change the group parameter to 2 for the function calls being used with the second group.
    Good luck with your application.
    Spencer S.

  • How can I have IMessage and SMS in the same thread

    My boyfriend has an iPad mini and a non Apple phone that sends SMS.  I know have two separate threads in messages, one for iMessage and one for SMS.  Even though I have added his email that is used to send iMessages to his contact on my phone, it is still showing as two different conversations on my phone.  Is there a way that I can see both types of message as one conversation?  I hope this makes sense.

    My boyfriend has an iPad mini and a non Apple phone that sends SMS.  I know have two separate threads in messages, one for iMessage and one for SMS.  Even though I have added his email that is used to send iMessages to his contact on my phone, it is still showing as two different conversations on my phone.  Is there a way that I can see both types of message as one conversation?  I hope this makes sense.

  • How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    Phone A = phone with information you want duplicated
    Phone B = phone that you want to copy from A
    Backup Phone A.
    Wipe Phone B using these instructions. What to do before selling or giving away your iPhone, iPad, or iPod touch - Apple Support
    Phone B should be on the 'Hello' screen. Do not swipe it. Launch iTunes. Plug in Phone B.
    When iTunes asks if you want to set up as new phone or restore from backup, choose restore from backup of Phone A.
    After this setup, any changes to one phone (i.e. adding a contact, downloading an app) will have to be manually duplicated on the second phone, if that is your desire). Making changes to one phone will not affect the other after setup.

  • I had my Itunes account disabled due to fraud, if i create a new itunes account how can i switch purchases and apps to the new ID?

    i had my Itunes account disabled due to fraud, if i create a new itunes account how can i switch purchases and apps to the new ID?

    Hi ...
    Just be cause the account was disabled (Apple ID) doesn't mean you can't reset the password and have access to your iTunes purchases.
    Use the iforgot link to reset your password > Apple ID: "This Apple ID has been disabled for security reasons" alert appears
    If you have problems resetting, use the email form here >   Apple - Support - iTunes Store - Contact Us
    edited by:  cs

  • Somehow my iTunes app has been put into the trash.  How can I get this and all of the stuff that was in it back to my Application folder?  I try to drag it out of trash, but it won't work.

    Somehow my iTunes app has been put into the trash.  How can I get this and all of the stuff that was in it back to my Application folder?  I try to drag it out of trash, but it won't work.

    Also, when I do try to drag it out of the Trash to put it back into Applications (on the Finder sidebar), it asks me to authenticate with the administration password.  I enter it, and then a window appears saying that I can't do that because I do not have permission to modify iTunes.  Please help.

  • How do I type Hebrew and English on the same page

    How do I type Hebrew and English on the same page in Indesign?

    What version of InDesign are you using? And on what operating system? Switching keyboard ("input methods") is in your OS, not in InDesign. InDesign has had the capability to display right-to-left languages since CS4, but only the Middle East edition has the abilities to actually manipulate Hebrew text. If you're trying to do a bilingual, bidirectional document, you'll need the ME edition. If you are a CC subscriber, it comes with your subscription; if you are not, you'll need to buy another version of ID, or a plugin that will allow you to access those RTL features.

Maybe you are looking for