|
-
Oct 6th, 2010, 06:16 PM
#1
Thread Starter
Lively Member
[RESOLVED] String assistance
I have a button which places text into a text box which is then copied to emails.
here is the code:
TextBox40.Text = "IP Address :" & Ip & vbCrLf & "Default Gateway:" & Gw & vbCrLf & "Subnet Mask :" & Sm & vbCrLf & "DNS Servers :" & Dns
which results in:
IP Address :
Default Gateway:
Subnet Mask :
DNS Servers :
I'm trying to make the colons line up in a straight line vertically but can't seem to get them to match.
Any ideas?
-
Oct 7th, 2010, 05:49 AM
#2
Re: String assistance
What I would suggest is to create your own userform and then use labels to show that text. It will be very simple to align the text that ways
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 8th, 2010, 05:43 PM
#3
Thread Starter
Lively Member
Re: String assistance
That will work, thanks.
Any idea why I can't get the last 3 characters removed with this condition?
If Right(test, 3) = "/##" Then
MsgBox Left(test, (Len(test) - 3))
End If
-
Oct 9th, 2010, 06:10 AM
#4
Re: String assistance
works for me
make sure no spaces at end of string
there is also sendmessage API with em_settabs
to align text in textbox
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Oct 11th, 2010, 10:37 AM
#5
Re: String assistance
 Originally Posted by jsublime
That will work, thanks.
Any idea why I can't get the last 3 characters removed with this condition?
If Right(test, 3) = "/##" Then
MsgBox Left(test, (Len(test) - 3))
End If
What is the value of 'test'?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 11th, 2010, 12:25 PM
#6
Thread Starter
Lively Member
Re: String assistance
dim test as String
test=textbox41.text
-
Oct 11th, 2010, 12:36 PM
#7
Re: String assistance
And what is the value of textbox41.text ?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 11th, 2010, 01:19 PM
#8
Thread Starter
Lively Member
Re: String assistance
ive been testing it with various entries similar to 55.55.55.100 and 55.55.55.100/30
-
Oct 11th, 2010, 01:33 PM
#9
Re: String assistance
I could be wrong but I guess what you are trying to do is 'String Comparison'...
Here is an example of what I think you want... (In case I am wrong, then ignore this post...)
Code:
Sub Sample()
Dim StrSample As String
StrSample = "55.55.55.100/30"
If Right(StrSample, 3) Like "/##" Then
MsgBox Left(StrSample, (Len(StrSample) - 3))
End If
End Sub
Last edited by Siddharth Rout; Oct 11th, 2010 at 01:36 PM.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 11th, 2010, 02:13 PM
#10
Thread Starter
Lively Member
Re: String assistance
Interesting, that worked. Thanks!
-
Oct 11th, 2010, 02:14 PM
#11
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|