Allow Certain Characters In Certain Positions In Text Box?
Feb 10, 2010
For example I only the second character in each line to be an x, while the 3nd to 10th character must be a hex digit.At the moment I use a Select Case, then check the position of the caret (using textbox.selectionstart) and see if the key being pressed is a "legal" character.Is there a better way of doing this as it slows down on large amounts of text.
This is the code I have at the moment:
Select Case TextBox1.SelectionStart
Case TextBox1.GetFirstCharIndexOfCurrentLine + 1
[code]......
View 4 Replies
ADVERTISEMENT
Apr 12, 2010
For a project I need to do a String strX is said to be a cyclic rotation of a String strY if it's possible to rotate the characters in strY by some number of positions, n, such that strY becomes strX. I don't mean rotate in a Caesar sense here but in a left-right (or right-left) sense. For instance, strX = abanan is a cyclic rotation of strY = banana because rotating the characters in banana to the right by n=1 (i.e., by one position), wrapping accordingly, yields abanan. Similarly is strX = anabana cyclic rotation of strY = banana because rotating the characters in banana by n=3.I need to write an application that returns True if strX is a cyclic rotation of strY otherwise the result is False. I'm looking into how to do this, I know it will involve and if then statement and possibly some loops. Is there anyone who can help me better understand what I should do?
View 4 Replies
Apr 13, 2011
I'm making a custom control suited for handling passwords. I have created a control that inherits from a text box and I have implemented a lot of things so far. But what i want to do now is create a system so that when a user types It will display his last character typed for a X amount of time.Is there a way to turn only selected characters into password characters and still be able to get the password text from the Text property ?
View 3 Replies
Aug 4, 2009
I know that the topic is kind of weird, but I will explain that here. I am reading text from a text box and inserting that into a listbox. I am wanting to read what the user inputs into the text box and add a character between each character they type. Here is what im wanting to do written out[code]...
View 4 Replies
Apr 14, 2012
I am trying to auto tab to the next text box after my limit of characters has been reached in a text box. Visual Basic 2010 Can this be set in the properties? I have 7 boxes, each allowed to hold only one character.
View 5 Replies
Feb 7, 2009
is it possible to make first 60 characters in a rich text box a different color than the remaining text?
View 25 Replies
Feb 18, 2011
Is it possible to add text to a multiline textbox in a particular column? Like so:
Sugar 10 Ohio
Coffee 50 Texas
Or should I be using a different contro
View 5 Replies
Dec 18, 2011
i'm creating a game like text twist. that when i press letter a, i need to determine which picturebox contains letter a and display it to different location. that also goes to the proceeding letter a's. for example, i have a jumbled letters "aamba". in my code, it only gets the first letter a and removes it form the screen, it's nowhere to be found. and it won't recognize that i still have other letter a's i'm pretty sure about the location that i set it to be placed.here is my
(it's kind of brute force i think)
ElseIf e.KeyChar = Chr(97) Then
counter1 = 0[code].....
View 7 Replies
Mar 5, 2011
I'm trying to make my own clone of space invaders as it's been about a year since I've done any programming, and I imagine this will be a good way to get back into it. The main issue that I am having right now, is that I am basically clueless as to how I go about moving the player on a keypress. I have the code for the keyboard input correct, how to move my picturebox.
Here's my code so far (in a nutshell):
Dim PlayerPositionX as integer
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.Left
[Code] .....
I imagine I probably messed up very badly on this, but I'm completely lost!
View 4 Replies
May 23, 2011
I have 20 PictureBoxes named PictureBox2 through to PictureBox 21, where I need to conditionally set the positon of them. I was wondering if there is a more efficient way to set their positions than to copy the code out 20 times. This is what I have so far:
For NextPos As Integer = 2 To 21
Select Case Direction
Case 1
[code]....
View 4 Replies
Aug 5, 2010
how i could get the icons positions i made some code to get the file names and everything but wanted to know how i could get there positions! also i found some codes with google but most of them where in vb6?
View 10 Replies
Jan 12, 2010
I like to put my Code windows on my 2nd monitor. But after I close them they always reappear as tabs on my primary monitor. How can I get VB2010 to remember to put them on the secondary monitor instead?
View 1 Replies
May 19, 2012
i am working on an examination system. the system has to compute the grades and position of each student per stream and per class.each class has got 4 streams. I save the studentsmarks in the database. i want the system to determine the positions of students and the position of each student to appear on the rtf.. report, for example:
Position in stream:4
Position in Class: 21
[code].....
View 3 Replies
Sep 28, 2010
I am attaching a sample working program. But in this program i need to do some changes,those changes i have explained in the .docx file.
View 5 Replies
Jul 2, 2008
I have 3 splitcontainers on my form. Each splitcontainer has vertical splitter orientation
This forms 3 'panels' which are resizable by dragging their respective splitters.
Each vertical 'panel' is then split horizontally by adding another splitcontainer with horizontal splitter orientation. I now have 3 column 'panels' each of which is split into 2 'rows'
My question is :
In a nested splitcontainer scenario
When a user drags splitters and resizes panels,
how can I remember the last splitter location
so that when the form is closed and reopened,
it remembers the last used positions ?
View 13 Replies
Jan 13, 2010
I am making a game that is similar to Dance Dance Revolution. As you know, there are moving arrow keys, but when i run the program, only one arrow moves up in a loop. I don't understand what is wrong with the code. Also, the score is messed up. It doesn't add or minus points.
Code:
<!--c1-->
CODE
View 3 Replies
Jan 17, 2012
I would like to know if it is possible to switch the position of a StateImage with that of an IndexImage for a TreeNode in a Winforms TreeView? Please refer to the image below for an illustration. The first TreeNode has a stateImage and the second one doesn't. My aim is for all IndexImages to align to the left and the StateImage (if any) to be to the right of the IndexImage. The resulting tree would look something like: I think I have to set the tree DrawMode to OwnerDraw and override OnPaint. I read this msdn link but nothing there was said about drawing images.
View 1 Replies
Jul 22, 2009
This I'm almost certain is an easy problem for those with more experience than me. I just need a routine that trades the places of 2 members of a collection class.
For example: If there are 5 objects stored in a CList of() collection class, I want to swap item # 3 and #5 (or any pair of indexes), what would be the code?
This simple problem has my head spinning because once you remove a member all the indexes change.
View 8 Replies
Jul 22, 2010
I have two points (x1, y1) and (x2,y2) and have a straight line between the 2 points, from this I can work out the distance between the 2 points lets say it is 50.What I want to do is increase or decrease the length of the line by a predefined amount lets say 10.So If I increase the line length by 10 (from 50 to 60), What I want to work out is what point(x3,y3) would be at the end of the increased line.Hope this makes sense.I have tried to work out the new point using the angle but it does not work correctly, it does not seems to produce a perfectly straight line and the angle from point (x1,y1) to the new (x3,y3) is not the same as the angle from point (x1,y1 to x2,y2).
This is what I have tried:
:I work out the angle
aAngle =Math.Atan((Y2 Y1) / (X2 X2))
[code].....
View 1 Replies
Jun 18, 2010
How to find current positions of cursors in any textbox or listbox?
View 1 Replies
Jan 26, 2012
i trying "Removing the first 3 characters of text box's text".
i tried this
TextBox3.Text.Remove(3)
View 4 Replies
Mar 23, 2010
I dont want to be setting the index positions and lenghth to a specific number becuase when i choose a different name from the listbox that is at a different position or longer it wont display it properly. explain to me another way around this so as it will allow any details to be selected and read???
[Code]...
View 16 Replies
Jun 13, 2011
When btnSetup is clicked, 7 rows with 24 colored predefined rectangles are displayed in the pbColors picture box as as intended. The controls on the first page of a tab control. I would like this display to remain intact when I change tab pages but when I return to this tab page the picture box is cleared. If I click the button, for some reason the group of colors is displayed twice, one after the other, instead of once as intended.
[Code]....
View 3 Replies
Dec 29, 2009
If TextBox1.Text.Length < 9 Then it have 1 charakter and it work i need that when the text is more then 9 charakters then it work.
View 6 Replies
Mar 14, 2010
I need a simple method of counting all characters in a text box and when a button is clicked a message must display if the amount of characters has exceeded 25.
View 4 Replies
Feb 23, 2011
Possibly a simple question, but I want to be able to "do nothing" if a value in a text box is less then 3 characters[code]...
View 5 Replies
Feb 19, 2011
write a vb script which filtersout characters from a string
example input string is The.Quick.Red.Fox.Jumped.Over.The.Fence
and illegal characters are 'the' '.' 'Red' 'quick'
the output should be quick fox over fence
View 1 Replies
Oct 8, 2011
I am sending SNMP SystemName query to local host and in the output i m getting little square characters instead of the specific system name..
Imports System.Text
Class Form1
Dim commlength As Integer, miblength As Integer, datatype As Integer, datalength As Integer, datastart As Integer
[Code].....
View 1 Replies
Nov 29, 2010
I have a string of text i captured within AutoCAD (0.000000, 0.000000, 0.000000) wich is saved to a text based file named position.txt.as you probably have gatherd with a file name such as position.txt the text could be composed of any random number combination eg: (5.745379, 0.846290, 150.6459046).However for it to be of any use to me I need the captured string to exist without spaces or brackets how can i achiev this in VB.net?
View 2 Replies
Apr 13, 2012
how count textbox only this symbol # example:spider#spider#spider there is two hash symbols textbox count=2 like that i want to know code.
View 3 Replies