5 Replies - 708 Views - Last Post: 10 February 2013 - 08:10 AM Rate Topic: -----

#1 Rjjvv  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 29-January 13

Select text in VS 2012

Posted 09 February 2013 - 01:20 PM

Hi, how do I select text in a text box between point A to Z and then continue with the loop

eg:

TextBox1.Focus()
TextBox1.Selectionstart(at point A)
TextBox1.SelectionLength(ends at point B)

Then

TextBox1.SelectedText = "Hello"

But when there is more than 1 point A and Z (the thing I can't get right) is when This happens and doesn't continues to the next point A

A hi my name is ### Z sdljglsgsjlk A hello guys Z

So "hi my name is ###" should then (with "hello guys") turn to Hello
So it must be "Hello sdljglsgsjlk Hello"

Is This A Good Question/Topic? 0
  • +

Replies To: Select text in VS 2012

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: Select text in VS 2012

Posted 09 February 2013 - 01:29 PM

If you're working in VS 2012, then you don't know what language you're coding in. VB6 is 10 years dead.


Please read: This is not the VB.NET forum
Please read: Is learning VB6 now a complete waste of time?
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: Select text in VS 2012

Posted 09 February 2013 - 01:35 PM

I can't follow what you are rambling about in your question. Maybe its just me but I shouldn't need Ridalin to read this and have it make sense.

But I think the gist is you want to replace some text.

First - stop trying to do it in your textbox and with selection. Don't treat texboxes and other controls like they are variables.

Just get the text.
Manipulate the string.
Then replace all the text in the textbox.

There are lots of methods for a string such as string.replace that would probably be helpful if you read about them.

You could also regex the string to find something within a pattern such as between two specific words or characters then replace it.
http://msdn.microsof...y/xwewhkd1.aspx
Was This Post Helpful? 1
  • +
  • -

#4 Rjjvv  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 29-January 13

Re: Select text in VS 2012

Posted 10 February 2013 - 07:26 AM

Sorry, I use VB6 for this code

Please and Thanks
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: Select text in VS 2012

Posted 10 February 2013 - 07:49 AM

Rjjvv - I don't think you know what you're talking about.

Someone correct me if I'm wrong - but I don't think VS12 even supports VB6. I don't do VB, but in trying to create a VB project I don't see a way to create a VB6 application from within VS12.
Was This Post Helpful? 0
  • +
  • -

#6 Rjjvv  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 29-January 13

Re: Select text in VS 2012

Posted 10 February 2013 - 08:10 AM

I have VB and VS so doesn't matter what code it is VB or VS
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1