Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

[76] TextBox Control

Last post 02-12-2008 11:28 AM by bishnupatro. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [76] TextBox Control

    This thread is for discussions of TextBox Control.

    • Post Points: 75
  • 01-31-2002 8:50 PM In reply to

    • Domino
    • Not Ranked
    • Joined on 01-31-2002
    • New Member
    • Points 10

    Text Boxes

    Is there a piece of coding that can be used with a button to clear the contents of text boxes?
    • Post Points: 0
  • 02-14-2002 5:52 AM In reply to

    • James Crowley
    • Top 10 Contributor
    • Joined on 12-07-2000
    • United Kingdom
    • Guru
    • Points 14,730
    • SystemAdministrator
    Code:
    Private Sub Command1_Click()
       Text1.Text = ""
    End Sub
    • Post Points: 0
  • 09-04-2002 12:09 AM In reply to

    • seba1979
    • Not Ranked
    • Joined on 09-03-2002
    • New Member
    • Points 60

    Help! with MultiLine Textbox and its scrollbar!

    Hello!

    My question is the following...

    I am building a CHAT Program in VB, to write the text in the chat I use a 'SingleLine' Textbox and above it I have the BIG MultiLine TextBox with a vertical scrollbar.

    The MultiLine TextBox shows my messages and the other users' messages but I have a problem, when new text is added to the TextBox, this Control REFRESHES and sets the SCROLLBAR to it's <TOP>, but what I need is to do exactly the OPPOSITE.... to go to the BOTTOM !! because the NEW TEXT added is in the BOTTOM.

    I think that I have to put something in the CHANGE Event of the TextBox to automatically go to BOTTOM (the scrollbar) in order to SHOW the last added TEXT.

    IF YOU KNOW SOMETHING TO SOLVE THIS, PLEASE HELP ME!

    Thanks!!!!!!!!!!

    Sebastián from ARGENTINA.
    • Post Points: 0
  • 11-27-2002 6:35 PM In reply to

    • Kenyai
    • Not Ranked
    • Joined on 11-27-2002
    • New Member
    • Points 5
    I had the same problem for a long time.
    This piece of code makes the scrollbar move down to the bottom.
    Unfortunately, in my programs, it does so even when you're trying to scroll up and look at previous conversation.
    If anyone can help me with that, I'd be grateful.

    Text1.SelStart = Len(Text1.Text)
    • Post Points: 0
  • 08-15-2003 4:38 AM In reply to

    • kc8pnd
    • Not Ranked
    • Joined on 08-15-2003
    • New Member
    • Points 35

    Multiline textboxs and its colors?

    I am creating a chat client and have go the chat room information to appear in a multilined textbox. It works great but all the text is the same color, is there a way to make every other line a different color? Also is there a way to make the text that I have sent be a different color then the rest?
    Thanks for the help
    Mike
    • Post Points: 0
  • 09-02-2003 11:17 AM In reply to

    • zarg
    • Not Ranked
    • Joined on 09-02-2003
    • New Member
    • Points 5
    Oooops, the following is C# code...

    Try this:

    Code:
    textBox1.SelectionStart = textBox1.Text.Length;
    textBox1.SelectionLength = 0;
    textBox1.ScrollToCaret();


    This can be added directly after the Text update, ie:

    Code:
    textBox1.Text+= sLine+" \r\n";
    textBox1.SelectionStart = textBox1.Text.Length;
    textBox1.SelectionLength = 0;
    textBox1.ScrollToCaret();


    If there is alot of lines being pasted then the textBox will flicker.

    • Post Points: 0
  • 10-10-2003 12:42 PM In reply to

    • CSmith
    • Not Ranked
    • Joined on 10-10-2003
    • New Member
    • Points 45

    Selecting all text on GotFocus event

    Is there a way of selecting all the text in a text box when it gets the focus in VB6?
    I'm in the middle of writing an application and would like the users to be able to type straight over the prompt when they tab in to the box or click on it.

    Was hoping for something along the lines of...

    private sub text1_gotfocus()
        text1.selectall
    end sub

    but can't seem to find anything simple that'll work.
    Or should I be using a rich text box rather than a normal one?

    Thanks!
    • Post Points: 0
  • 02-12-2004 10:23 PM In reply to

    • RueprtR
    • Not Ranked
    • Joined on 02-12-2004
    • New Member
    • Points 15
    Private Sub optSelect_Click()
       ' place the insertion point at the beginning
       txtDisplay.SelStart = 0
       ' find the length of the string and
       ' select that number of characters
       txtDisplay.SelLength = Len(txtDisplay.Text)
       
       ' set the focus to the text box so we can see
       ' the result of our settings
       txtDisplay.SetFocus
    End Sub

    Hope it helps.


    I found this code in the controls.vbp located in the MSDN Samples VB 98 folder
    • Post Points: 0
  • 02-29-2004 12:06 AM In reply to

    • wes321
    • Not Ranked
    • Joined on 02-29-2004
    • New Member
    • Points 5

    Deleting text

    How can you delete all ","'s from a text box
    example i have a text which i save using the "Write" function but then when i reload it, it comes up wit the "" which i dont want to come up.  How do i make it when i click a button it deletes all "" from the textbox?
    • Post Points: 0
  • 11-27-2004 11:52 AM In reply to

    • johnm
    • Not Ranked
    • Joined on 11-27-2004
    • New Member
    • Points 5

    Textboxes - knowing when a scroll happens

    I have hit a dead stop.

    (although while typing this I thought of a book and now about something which I guess will be called en_vscroll)  
    I'm still asking though because this may not be the answer and I'm sure going to struggle with this anyway.

    I need to provide my own scrollbar for textboxes.  Yes, this is a waste of time when they have perfectly good ones anyway.
    But I have graphical buttons and after responding to users requirements of not having boring buttons I now have new complaints about scrollbars looking old fashioned.

    Anyway, I can control the scroll but I have no way of knowing when the user has caused the scroll with cursor movement instead of clicking in my scrollbar.

    I don't want to replace even more perfectly good functionality.  Instead, I just want to catch that scrolling action when it happens.

    I think I know roughly what the code will look like to do this.  I have an example of replacing the word wrap in a textbox.  I haven't tried running it yet but don't think it will work because I can see a typo in it.  THe author tidied up his code instead of just giving the original and he forgot to rename a variable.  I don't know which variable he forgot to rename.

    Even knowing the syntax does not help me find an example on the net.  I think I just need the semantics and I can figure the rest out.  I can't understand how come I can't get this from a search but really I have tried very hard and I tend be good at searching for stuff like this.

    I assume I capture and replace the scroll action.   So looking up some pre-defined constants is what I need to do.

    Please please someone give me an example or tell me how I look this up.  The help for this doesn't seem to be anywhere.

    I admit this shows my ignorance but I am sort of new to VB and never really learnt Windows programming properly.  If anyone knows an alternative to Microsoft's offering for Assembler in Windows please tell me.  I will pay quite a bit for it.

    John Morley
    • Post Points: 0
  • 05-16-2005 10:21 PM In reply to

    • Col
    • Not Ranked
    • Joined on 05-16-2005
    • New Member
    • Points 5

    Display Data in Textbox

    Hi, sorry but Newbie here,
                                          From an excel workbook I want to display the data from cell A1 & B1 next to each other in a textbox in my Visual Basic 6 project. Then next line A2 & B2 and so on. I've got as far a displaying it in a list but not how I want it,
                                                                                                        thank you  
    • Post Points: 0
  • 05-26-2005 7:58 AM In reply to

    • Dipti22
    • Not Ranked
    • Joined on 05-17-2005
    • New Member
    • Points 10

    Plz Help (Textbox)

    Hello all
         I  am doing my project in asp.net . when a page gets loaded at that time i dont want a image control lie beside the taxtbox. but  whenever  a textbox got the focus , the image control should come beside the textbox.  I dont know how to do this as in asp.net textbox don't have any Gotfocus() event.
              Please help me , it's very urgent....
         
    • Post Points: 0
  • 11-15-2005 6:09 PM In reply to

    • bmahler
    • Not Ranked
    • Joined on 11-15-2005
    • New Member
    • Points 5
    Quote:
    [1]Posted by RueprtR on 12 Feb 2004 10:23 PM[/1]
    Private Sub optSelect_Click()
       ' place the insertion point at the beginning
       txtDisplay.SelStart = 0
       ' find the length of the string and
       ' select that number of characters
       txtDisplay.SelLength = Len(txtDisplay.Text)
       
       ' set the focus to the text box so we can see
       ' the result of our settings
       txtDisplay.SetFocus
    End Sub

    Hope it helps.


    I found this code in the controls.vbp located in the MSDN Samples VB 98 folder


    You can put this in the gotFocus event... like so
    Code:
    Private Sub txtBackground_GotFocus()
    text1.SelStart = 0
    tex1.SelLength = Len(text1.Text)
    End Sub


    h0pe this helps javascript:smilie('')
    big grin
    • Post Points: 0
  • 02-12-2008 11:28 AM In reply to

    Re: [76] TextBox Control Flickering Problem in C#

    Hi,

         In my C# application there is a multiline textbox with vertical scrollbar. When the multiline textbox get updated with new data, the vertical scrollbar flickers (from top to bottom) with each update on the textbox. How can I prevent the scrollbar flickering when the multiline textbox get updated each time.

    Thanking you in advance.

    Bishnu 

     

     

     

    • Post Points: 5
Page 1 of 1 (15 items)