Results 1 to 3 of 3

Thread: [RESOLVED] TextBox help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Posts
    186

    Resolved [RESOLVED] TextBox help

    Hi, i am making a program and one of its features is a skinner and iv got that all working but im stuck on a import bit. Iv got it all working to import and save data to a ini file but the problem is getting rid of [ and ] around the title of theme so it can be added to a listbox displaying all the themes. But i need the [ and ] around the title so i can save it.

    If i had a textbox that had text in like this...

    [Theme 1 title here]
    backcolour=478593
    textcolour=485849
    etc...

    or

    [Theme title]
    backcolour=478593
    textcolour=485849
    etc...

    the textbox text will change according to the name of the title of theme. But i need it to be added to a listbox which displays all the themes but i want it to not have the [ and ] around it. So my problem is i can't figure out how to get rid of them.

    I have some code to get rid of the first one...

    Code:
    Text1.Text = Split(Split(Label1.Caption, "[")(1), ".")(0)
    so that gets rid of the first [ in the label title and adds the new title to a textbox so it will look like this Theme title]

    but does anyone know how i would get rid of the second one at the end?

    Is there a way to make a text box so when text is added to it if there is [ or ] in it, it will delete them and keep the other text in it.

    Basically......
    If i can a textbox with this text in - [Text here] , is there a way to put that text into a different textbox without the [ and ] so it would be Text here instead of [Text here]
    Last edited by Banjo; Dec 15th, 2007 at 12:21 PM. Reason: Needed to add more text

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,518

    Re: TextBox help

    What about this,
    Code:
    Text1.Text = Split(Split(Label1.Caption, "[")(1), ".")(0)
    Text1.Text = Mid(Text1.Text, 1, InStr(Text1.Text, "]") - 1)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Posts
    186

    Re: TextBox help

    Thanks sooooooo much that works great!!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width