Click here to Skip to main content
15,888,579 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionicacls vbscript - disabling inheritance and removing permissions a security group Pin
Chris Cooper26-Sep-14 3:17
Chris Cooper26-Sep-14 3:17 
AnswerRe: icacls vbscript - disabling inheritance and removing permissions a security group Pin
Eddy Vluggen26-Sep-14 6:03
professionalEddy Vluggen26-Sep-14 6:03 
QuestionPloting xy grapgh on VB Pin
Member 1051522523-Sep-14 20:31
professionalMember 1051522523-Sep-14 20:31 
QuestionMore than 1 barcode reader in one pc Pin
Member 380289623-Sep-14 19:19
Member 380289623-Sep-14 19:19 
AnswerRe: More than 1 barcode reader in one pc Pin
Bernhard Hiller23-Sep-14 22:01
Bernhard Hiller23-Sep-14 22:01 
AnswerRe: More than 1 barcode reader in one pc Pin
Tino Fourie24-Sep-14 6:40
Tino Fourie24-Sep-14 6:40 
AnswerRe: More than 1 barcode reader in one pc Pin
ZurdoDev24-Sep-14 10:07
professionalZurdoDev24-Sep-14 10:07 
QuestionTextBox Validation Pin
Benniiit23-Sep-14 7:09
Benniiit23-Sep-14 7:09 
Please I'm using vb.net 2013 and I have a textbox named txtRecipients

Now i want to check for the following:

1. The phone no. should always start with 233 followed by any digit other than zero like: 233201245685
2. Multiple phone numbers should be separated by a comma, like 233201245685, and the comma replaced automatically before the start of another phone number in the same format. So if two phone numbers are entered they should be like this:
233201245685,233547345696

I did something like this in the leave event. Is there any better way to do this as the comma is not getting replaced at a specific position. I used both the remove and replaced functions, but that did not work. Thanks in advance

<pre lang="vb">

Dim str1 As String = Mid(Me.txtRecipients.Text, 1, 1)
Dim str2 As String = Mid(Me.txtRecipients.Text, 2, 1)
Dim str3 As String = Mid(Me.txtRecipients.Text, 3, 1)
Dim str4 As String = Mid(Me.txtRecipients.Text, 4, 1)
Dim str13 As String = Mid(Me.txtRecipients.Text, 13, 1)
If str1.Trim <> 2 Then
Me.txtRecipients.Focus()
MsgBox(The first digit must be 2)
Exit Sub
End If
If str2.Trim <> 3 Then
Me.txtRecipients.Focus()
MsgBox(The second digit must be 3)
Exit Sub
End If
If str3.Trim <> 3 Then
Me.txtRecipients.Focus()
MsgBox(The third digit must be 3)
Exit Sub
End If

If str4 = 0 Then
Me.txtRecipients.Text.Replace(0, String.Empty)
Me.txtRecipients.Focus()
MsgBox(Phone No. must not start with 0. Format e.g. 233243404804)
Exit Sub
End If

If str13 <> "," Then
' Me.txtRecipients.Text.Replace(str13, ",")
Me.txtRecipients.Focus()
MsgBox(Phone No. must not start with 0. Format e.g. 233243404804)
Exit Sub
End If

</pre>

-- modified 23-Sep-14 13:46pm.
AnswerRe: TextBox Validation Pin
JR21223-Sep-14 21:18
JR21223-Sep-14 21:18 
QuestionRemove double spaces in a textbox on keypress Pin
Benniiit20-Sep-14 3:10
Benniiit20-Sep-14 3:10 
AnswerRe: Remove double spaces in a textbox on keypress Pin
Bernhard Hiller21-Sep-14 21:43
Bernhard Hiller21-Sep-14 21:43 
AnswerRe: Remove double spaces in a textbox on keypress Pin
Mycroft Holmes21-Sep-14 22:28
professionalMycroft Holmes21-Sep-14 22:28 
QuestionMultiline text box manipulating Pin
Member 1109601819-Sep-14 17:58
Member 1109601819-Sep-14 17:58 
SuggestionRe: Multiline text box manipulating Pin
Richard MacCutchan19-Sep-14 21:22
mveRichard MacCutchan19-Sep-14 21:22 
GeneralRe: Multiline text box manipulating Pin
Member 1109601819-Sep-14 22:17
Member 1109601819-Sep-14 22:17 
QuestionDirectx 11 and vb6.0 or .net Pin
Otekpo Emmanuel19-Sep-14 12:17
Otekpo Emmanuel19-Sep-14 12:17 
SuggestionRe: Directx 11 and vb6.0 or .net Pin
Richard MacCutchan19-Sep-14 21:24
mveRichard MacCutchan19-Sep-14 21:24 
AnswerRe: Directx 11 and vb6.0 or .net Pin
Dave Kreskowiak20-Sep-14 12:22
mveDave Kreskowiak20-Sep-14 12:22 
Questionhow to convert this VB10 to VB6 Pin
Member 1109056417-Sep-14 16:08
Member 1109056417-Sep-14 16:08 
AnswerRe: how to convert this VB10 to VB6 Pin
Dave Kreskowiak17-Sep-14 17:14
mveDave Kreskowiak17-Sep-14 17:14 
AnswerRe: how to convert this VB10 to VB6 Pin
NightWizzard21-Sep-14 2:58
NightWizzard21-Sep-14 2:58 
QuestionVb.net + SQL Server : Speed difference using float vs Decimal Pin
dilkonika16-Sep-14 14:32
dilkonika16-Sep-14 14:32 
AnswerRe: Vb.net + SQL Server : Speed difference using float vs Decimal Pin
Bernhard Hiller16-Sep-14 21:40
Bernhard Hiller16-Sep-14 21:40 
AnswerRe: Vb.net + SQL Server : Speed difference using float vs Decimal Pin
Chris Quinn16-Sep-14 21:42
Chris Quinn16-Sep-14 21:42 
AnswerRe: Vb.net + SQL Server : Speed difference using float vs Decimal Pin
Richard MacCutchan16-Sep-14 21:44
mveRichard MacCutchan16-Sep-14 21:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.