Allow Multiple Lengths On A Textbox?
Nov 18, 2010
I think this will be better than what I was thinking before.
How can I allow multiple lengths to a textbox.Allow multiple lengths on a textbox?
something like
if Not TextBox1.TextLength = 8 Or 11 Or 14 Or 18 Then msgbox("error")
View 5 Replies
ADVERTISEMENT
May 17, 2012
Can a substring have mutiple arguments? I am pulling a substring from a drop down list into my database for records, the string is between 6 and 8 numbers, is it possible to pass more than one argument to make this work?
Sample data:
DropDownList
123456 | Name
1234567 | Name
[Code]....
View 2 Replies
Jan 17, 2012
I have 6 array lists and I would like to know which one is the longest without using a bunch of IF STATEMENTS."if arraylist.count > anotherlist.count Then...." <- Anyway to do this other than this?
Examples in VB.net or C#.Net (4.0) would be helpfull.
arraylist1.count
arraylist2.count
arraylist3.count
arraylist4.count
arraylist5.count
arraylist6.count
DIM longest As integer = the longest arraylist should be stored in this variable.
View 5 Replies
Feb 26, 2012
I am working on a project that I scroll from one screen to another.
A particular string I have 2 variables that can be changed. If I stay on this screen I can change either variable just as I need
however when I change to another screen then return my string is 1 digit longer and when I wish to edit this string my program fails because the string isn't the expected length.
A portion of my program follows....The Y6 is just a counter. The MA is a conditional control.
ElseIf _
Y6 = 4 _
And MA = True _
[Code]....
Delete 0-27 then determine whats there "NC" or "NO" and simply change it. But again when I leave this particular screen and return my text length is no longer 29 charactors long, it is now 30 charactors.
View 10 Replies
Apr 20, 2011
Forgive me but i have a noob question, I cant seem to get my head around.I have a textbox.text string as "111.1, 22.2, 3333.3, 444.44" What I want to is extract the numbers which may be random lengths, but all separated by a comma to
dim i1st number as Integer
dim i2nd number as Integer
dim i3rd number as Integer
dim i4th number as Integer
I know how to search for one instance of a string in a string but taking the 1st part to the comma, then the next comma and so on is confusing me.
[Code]...
View 2 Replies
Sep 3, 2010
Basically I'm just trying to see if the date/time of files have changed on files.So I've got code something like this:-
Dim fi_source_CreationTime As DateTime = fi.CreationTime
Dim file_info_DateCreated As String = '** LOADED from a file **
If (fi_source_CreationTime = CDate(file_info_DateCreated)) Then
[code]....
View 21 Replies
Apr 5, 2011
I'm working on a Pythagorean Theorem program that calculates the sides and angles of a right triangle. I have the side measurements and all that down, but I can't find the Visual Basic function that will allow me to calculate the angles from the side measurements. I've tried asin and sinh, but both give me the wrong measure.
View 2 Replies
May 9, 2011
simple loop code to split a text which is displayed on the text box. All that will need to do is split the text into 48 char lengths.
View 11 Replies
Apr 4, 2012
I have an array of strings such as "blue", "green", "red" and I wish to sort them so the longest string comes first and the shortest last.
Currently I am creating another array with the lengths of each string in the array in the same index positions and using this array as the key array to sort by as can be seen below, but I think this could be optimised into one line perhaps?
Dim colours() As string = {"blue", "green", "red"}
Dim colourslength() As Integer
For i As Integer = 0 To colours.Length - 1
[Code].....
Edit: just realised I defined colours as a list in the example code, it's an array in my actual code.
View 4 Replies
Jul 30, 2009
I want to write the DS into a txt fie with predefined field lengths.
Code:Dim ds As New Data.DataSetda.SelectCommand = New SqlCommand da.SelectCommand.Connection = conn da.SelectCommand.CommandText = "SELECT * from Samp1" da.Fill(ds, "S1")
[Code]...
View 8 Replies
Jan 1, 2011
Is there any way to create a multidinensional array that contains arrays of different lengths (similar to nesting arrays of different lengths in python).
Because if I were to declare a variable Dim accounts(2,2) As Integer all 1D arrays at each dimension have the same length. Is there any way to create an array so that this is not the case?
e.g The above code would create an array like this:
[[0,0],[0,0]]
but would it be possible to create this:
[[0,0],[0,0,0]]
View 3 Replies
Mar 27, 2012
I am working on a program that opens a .txt file, finds the length of each line in the file, and then outputs the minimum and maximum lengths. For example, assuming this is the .txt file I am opening:
2789304
293048203
27598493
[code].....
I would like to return something like this:
Minimum length: 6
Maximum length: 9
I cannot use arrays for this assignment. I figured out how to get the maximum length but cannot figure out how to get the minimum. Am I going about this the right way or is there an easier way to do this? Here is what I have thus far:
Dim FileName As String
Dim FileReader As StreamReader
Dim FileLine As String
[code].....
View 4 Replies
Feb 1, 2008
I have a string which can be of any length. I want to loop tthrough this string and if there 53 characters assign that to Variable1, then loop round again and assign the next 53 characters or less to variable2 etc etc until the end of the string. Ideally I would not want to split words - but that is another problem.....
View 10 Replies
Mar 25, 2009
For a school program, I was assigned to use a .dat file to store and edit information while using VB to be it's front end( to appear in a listbox). I was also given what field length to use per field. I never worked with .dat files, so I have a few questions (all the google-ing Ive done say the same thing: every .dat file is different so you can't play around with them):
[Code]...
View 4 Replies
Feb 18, 2012
i need to take data input from a textbox such as this
[Code]...
and get it so i push a button and it seperates it out so it adds and looks like this inside a display field
[Code]...
View 6 Replies
Mar 25, 2009
I am writing a program where I would like the user to be able to save the contents from multiple textBox into a file and the retrieve the contents late.
View 5 Replies
Jun 9, 2011
how to have multiple colors in a textbox. Is this possible, or must I use a richtextbox?. I would like to keep it simple if possible by setting it up in a standard textbox.
View 2 Replies
Mar 31, 2010
There is a situation that I couldnt handle, I have 4 TextBox's and I am assigning the text to variable after loosing focus for 4 TextBox's as below;
(Variables assigned under class Form1)
Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
[code]....
View 3 Replies
Feb 1, 2012
The problem i am having is after checking if the field is blank i want program to stop at that, right now it is going ahead and checking the username password also even though the field is blank and printing wrong username password. i am really new at this so please excuse the lack of knowledge
[Code]...
View 2 Replies
Feb 12, 2012
I'm using VB2010 express and I want to set up my form to have all 22 textbox's start in read only so that my users cannot change the contents accidentally but have a button to enable the textbox's so they can.I know that i can set the properties for each textbox from true to false and back for each textbox but I was wondering if there is group way of doing this or do I need to do each one separately .
View 17 Replies
Mar 3, 2012
I'm trying to set multiple variables using a textbox.The way I'm trying to do it is have each variable seperated by a space so like this:#If textbox1.text.contains("test") then set variables from textbox1.text for each " " in textbox1.text define new variable(value, string1, string2, int1, int2, int3, int4, int5)#End If I just don't know how I would code something that can set these variables from a single line of text in a textbox seperated by nothing other than just spaces.
View 1 Replies
Jan 23, 2011
Here is my [code]...
My textbox (txtCopies) default value is 1 so naturally, as it is coded above, the datarow is added once into the Movies Table. But what I need to know is how to code if the txtCopies field has a greater integer value.
View 6 Replies
Sep 7, 2009
I can filter when I'm only checking with one textbox, but when i try to use multiple text box filters its does not work the way I want it to. I understand what is going on here but i don't know what to do to fix it. Basically I have my main form with the datagridview, there is a button on this form called filter. When the user will hit this button a small form will pop up with 5 text boxes, I want to give the user the ability to enter into any text box they wish and the datagrid view will update accordingly.The problem is when they enter into one text box it works fine, but when the try entering into a second test box the filter is only filtering from the original datatable and now the dataview.
Code:
Public Class Form2
Dim dvFilter As DataView
[code]....
View 2 Replies
Apr 21, 2010
I would like to know how to display 2 or more keys combination in (e.g. Textbox, msgbox...). When a user press "Ctrl + Alt + W", how to display the keypress of "Ctrl + Alt + W" in a Textbox.
View 2 Replies
Jun 16, 2011
Here is my code that I wrote its very simple.
Normal Code
If TextBox1.Text = "PleaseHelp" Then
Button1.Enabled = Enabled
End If
BUT I need like multiple correct logins I don't know how I forgot! EXAMPLE: If TextBox1.text = "PleaseHelp, HELP, Thanks" <--- gives me a error I know it isnt the correct way! I just cant figure it out and its basic code....
View 3 Replies
Jun 13, 2009
VB
Private Sub BTTNhypdir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTTNhypdir.Click
[code]....
View 3 Replies
Mar 11, 2010
I want to set Textbox1 to textbox 55 to .readonly =true by using says For loop,so i need not key in one by one. Any ways to do it?
I know sonthing like
For index As Integer = 1 To 55
Me.b.Controls("Textbox" & index).Text = index
Me.b.Controls("Textbox" & index).TabIndex = index
[Code].....
View 6 Replies
Jan 30, 2012
i've got my basic AutoTyper ready (well and one with autoupdating etc in it) but it's only a singular line. [Code] What I want to do it to type multiple lines, I know I'll have to enable multiline on the TextBox. I want it to type one line per time interval using 1 timer. I don't know how but I know it would have to count the lines but from then on I'm stuck. I will need to make it type line 1, then on the next loop line 2 and go on until it's reached the amount of lines from the count then repeat from line 1. [Code]
View 6 Replies
May 15, 2009
I am trying to modify our web based program to allow for a second column of information to be entered and updated to the same table as what was in the first column. This program was written by others, so I am trying to keep within their format and structure.The idea is to have three columns (a fourth is currently sThe first column is the label column, the second column is a numbered assessment (1-10) and is currently free form textbox, and the third column (the one I am not able to get updated) should be a free form text box allowing as much comment as possible (without being a SQL text field).
The following is the two sub sections of the vb script:
Sub GetSkillsAssessment()
Session("PeSkills") = Nothing
[code]......
View 1 Replies
Oct 20, 2010
How do I add, for example, all the numbers in the textbox (they are separated by spaces)? I tried a couple of methods but no luck so far. So for example, this is what the user will input in the textbox:
View 7 Replies