Post by Izy Coder on Sept 25, 2014 23:15:34 GMT 10
Hi all, if you know how to read a richtexbox like this : if the richtextbox1 text = Form1("My Form", 500,500) Then, form 1 text will be "My Form" and size will be "500x500". Can I make like that ? If can, how ? thanks.
Check Out My Project At VSlang InternetTM. More Project : - Poroxnoss Text Editor 2 - Added soon...
- TAP 2D Game Maker - Coming really soon...
- Easy Desktop - Discontinue..
|
|
Post by Nathan Lecompte on Sept 25, 2014 23:33:43 GMT 10
Hey Izy, I'm guessing you want to resize a form via string(text). You do so using the following code: MyForm.Size = New Size(500, 500) Or you're trying to read the string of the richtextbox to activate a command to create a form with the name "My Form" and a size of 500x500. Which wont work unless you already have an existing "base form" from which you can clone for every command. I don't have any code for this one though. :/ Hope this helps!
|
|
Post by Izy Coder on Sept 26, 2014 9:59:40 GMT 10
I want to read from .ini file then the richtextbox text is the .ini text.
Check Out My Project At VSlang InternetTM. More Project : - Poroxnoss Text Editor 2 - Added soon...
- TAP 2D Game Maker - Coming really soon...
- Easy Desktop - Discontinue..
|
|
Post by Prezence on Sept 26, 2014 10:30:05 GMT 10
To get the contents of the .ini into the richtextbox: if file.exists(filepath) then RichTextBox1.text = file.readalltext(filepath) end if
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
|
|
Post by Izy Coder on Sept 26, 2014 10:38:14 GMT 10
I know, but I want to only read a "My Form" and Size. Form1(My Form,500,500) - I don't want to read the Form1 and "()" symbol.
Check Out My Project At VSlang InternetTM. More Project : - Poroxnoss Text Editor 2 - Added soon...
- TAP 2D Game Maker - Coming really soon...
- Easy Desktop - Discontinue..
|
|
Post by Nathan Lecompte on Sept 26, 2014 10:44:30 GMT 10
I'm not sure what you mean...
|
|
Post by Izy Coder on Sept 26, 2014 11:30:20 GMT 10
The file.readalltext will read all the text. but I want only read the "My form" and "500,500" text. or read after the text "Form1(" and before the text ")"
Check Out My Project At VSlang InternetTM. More Project : - Poroxnoss Text Editor 2 - Added soon...
- TAP 2D Game Maker - Coming really soon...
- Easy Desktop - Discontinue..
|
|
Post by Nathan Lecompte on Sept 28, 2014 17:00:18 GMT 10
Oh right, silly me! Use this code: Dim text As String = File.ReadAllText("D:\Temp\MyFile.txt") Dim index As Integer = text.IndexOf("My form") If index >= 0 Then ' String is in file, starting at character "index" End If
Dim text As String = File.ReadAllText("D:\Temp\MyFile.txt") Dim index As Integer = text.IndexOf("500,500") If index >= 0 Then ' String is in file, starting at character "index" End If It's very basic and simple, you should be able to build on this. Hope this helps!
|
|
Post by Prezence on Sept 28, 2014 23:30:24 GMT 10
Or, If file.exists(file) then Dim str = file.readalltext(file) If str.contains("Form1") then Str = str.replace("Form1","").replace("(","").replace(")","") End if
'Now str has no form1 or parentheses so you can do whatever here End if
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
|
|
Post by Nathan Lecompte on Oct 6, 2014 12:21:38 GMT 10
If your question has been answered please press the "Accept" button next to the post which answered your question.
|
|