Click here to Skip to main content
15,923,164 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Date conversion problem!!!! Pin
Omar Mallat9-Dec-05 12:56
professionalOmar Mallat9-Dec-05 12:56 
GeneralRe: Date conversion problem!!!! Pin
Joshua Quick9-Dec-05 13:30
Joshua Quick9-Dec-05 13:30 
GeneralRe: Date conversion problem!!!! Pin
Omar Mallat9-Dec-05 18:33
professionalOmar Mallat9-Dec-05 18:33 
Questionpdf 2 image with itextsharp ?? Pin
darth_toni9-Dec-05 9:25
darth_toni9-Dec-05 9:25 
QuestionHi ! Pin
abhishk2001@yahoo.com9-Dec-05 8:03
abhishk2001@yahoo.com9-Dec-05 8:03 
AnswerRe: Hi ! Pin
Brent Lamborn9-Dec-05 10:53
Brent Lamborn9-Dec-05 10:53 
Questionadd chars to text at KEYPRESS Pin
Greeky9-Dec-05 2:45
Greeky9-Dec-05 2:45 
AnswerRe: add chars to text at KEYPRESS Pin
Roy Heil9-Dec-05 7:33
professionalRoy Heil9-Dec-05 7:33 
You need to set the cursor back to the end of the string. You can do that with the following line:
DateTimeExtended.SelectionStart = me.text.length
However, this would still cause problems, for instance, if the length is 5, and you go back and change character 2. You need more length checking. Try the following code:

Private Sub DateTimeExtended_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress<br />
Dim asciiInteger As Integer = Asc(e.KeyChar)<br />
Dim currentPosition As Integer<br />
Select Case asciiInteger<br />
Case 48 To 57 'Sayi<br />
currentPosition = Me.SelectionStart<br />
If currentPosition = Me.Text.Length Then<br />
Select Case Me.Text.Length<br />
Case 2<br />
Me.Text &= "."<br />
currentPosition = currentPosition + 1<br />
Case 5<br />
Me.Text &= "."<br />
currentPosition = currentPosition + 1<br />
End Select<br />
End If<br />
Me.SelectionStart = currentPosition<br />
e.Handled = False<br />
Case 8 'Backspace<br />
e.Handled = False<br />
Case Else<br />
e.Handled = True<br />
End Select<br />
e.Handled = False<br />
Case 8 'Backspace<br />
e.Handled = False<br />
Case Else<br />
e.Handled = True<br />
End Select<br />
End Sub 


Roy.
GeneralRe: add chars to text at KEYPRESS Pin
Roy Heil9-Dec-05 7:54
professionalRoy Heil9-Dec-05 7:54 
AnswerRe: add chars to text at KEYPRESS Pin
George B Gilbert9-Dec-05 9:30
George B Gilbert9-Dec-05 9:30 
Questionsetup wizard and registry handling Pin
Asim N.8-Dec-05 23:17
Asim N.8-Dec-05 23:17 
AnswerRe: setup wizard and registry handling Pin
George B Gilbert9-Dec-05 9:39
George B Gilbert9-Dec-05 9:39 
AnswerRe: setup wizard and registry handling Pin
Curtis Schlak.9-Dec-05 10:28
Curtis Schlak.9-Dec-05 10:28 
GeneralRe: setup wizard and registry handling Pin
Asim N.9-Dec-05 15:45
Asim N.9-Dec-05 15:45 
GeneralRe: setup wizard and registry handling Pin
Curtis Schlak.11-Dec-05 9:33
Curtis Schlak.11-Dec-05 9:33 
QuestionHow can I mount an image in VB.NET Pin
Weddi8-Dec-05 22:48
Weddi8-Dec-05 22:48 
AnswerRe: How can I mount an image in VB.NET Pin
Dave Kreskowiak9-Dec-05 5:47
mveDave Kreskowiak9-Dec-05 5:47 
Questionclearing a combobox Pin
microuser_20008-Dec-05 21:55
microuser_20008-Dec-05 21:55 
AnswerRe: clearing a combobox Pin
Asim N.8-Dec-05 23:19
Asim N.8-Dec-05 23:19 
GeneralRe: clearing a combobox Pin
microuser_20009-Dec-05 0:50
microuser_20009-Dec-05 0:50 
GeneralRe: clearing a combobox Pin
Asim N.9-Dec-05 2:39
Asim N.9-Dec-05 2:39 
QuestionCheck the instance of an object Pin
biglewy8-Dec-05 21:19
biglewy8-Dec-05 21:19 
AnswerRe: Check the instance of an object Pin
Asim N.8-Dec-05 23:22
Asim N.8-Dec-05 23:22 
QuestionDataBase Checking Table Exist or Not Pin
Sasmi8-Dec-05 19:51
Sasmi8-Dec-05 19:51 
AnswerRe: DataBase Checking Table Exist or Not Pin
abhinish8-Dec-05 23:38
abhinish8-Dec-05 23:38 

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.