For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
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
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
I have this textbox that users enter their names, but I realized that they enter their names by entering so many spaces. I used the replace function but it does not work well. Is there anyway to prevent this at keypress, when the user tries to press the space bar more than once? Thank you, all.
I am making a little app and I am stuck. I have a multilined textbox and I would like a button to take the text and reverse the line order. So if the text was numbered each line as 1->9, pressing the button will reorder the lines so they are 9->1.
Seems that line
PictureBox1.Left += And() +6
is erratic - or do you really have a function named 'And'?? If so you'll have to enclose this VB key word in square brackets like
PictureBox1.Left += [And]() +6
otherwise remove it to:
PictureBox1.Left += 6
This will move your picture box 6 pixel to the right an if resulting position exceeds 1000 pixel, the picturebox position will be reset to a default.
I'm writing a financial application , and I'm not sure about which data type to use.
I know that decimal is more precise that float , but I read that using decimal can significantly decrease the speed of calculations and the speed of storing data to database , so the speed of the application.
Is this true , and if yes is there a solution or should I continue to use float ?
Never use float (or double) for financial applications, as they are base 2 numbers and cannot accurately hold base 10 values. You can sometimes use integers, depending on the currency and values you need to represent.
I have to use a kind of data type that accept digits after decimal point.
so I need to choose between float and decimal.
But it is true that working with decimal is about 20 times slower than working with float ?
This is my question.
Thank you !