hey guys just calm down.
can u give me ure knowledge?
hehhe
hey guys just calm down.
can u give me ure knowledge?
hehhe
ma'am.. sayun ra na hehe. pm nq ang codes? or nakuha na nmu.. dali rana.. pm lng kung unsa..
naay mga functions ang vb nga matawag every keypress, keydown, and keyup ... pili lang ka asa ana nga mga functions gamiton nimo pag trap. dha sulod sa function dha nimo i-evaluate ug unsa ang ascii/scancode sa character nga iyang gi gamit.
additional off topic:
if mag trap ka ug mga functions keys like f1, f2, or mga arrow up, down events, mas maau ug ang scancode sa key ang imong i-evaluate para ma trap ni sila nga keys.
try this
Function KeyCodeNumeric(KeyCode As Integer, Optional AllowDecimal As Boolean = False) As Integer
'for use with keyup and key down events
'Allows only numeric entries
If KeyCodeESCKeys(KeyCode) Then
KeyCodeNumeric = KeyCode
Exit Function
End If
If AllowDecimal Then
If KeyCode = 110 Or KeyCode = 110 Then KeyCodeNumeric = KeyCode
Exit Function
End If
If Not (KeyCode >= 48 And KeyCode <= 57) And _
Not (KeyCode >= 96 And KeyCode <= 105) Then KeyCode = 0
KeyCodeNumeric = KeyCode
End Function
Function KeyCodeESCKeys(key As Integer) As Boolean
'for use with keyup and key dow events
' returns true if tab,enter,backspace, or delete keys are entered
If key = 8 Or key = 9 Or key = 13 Or key = 46 Then
KeyCodeESCKeys = True
Else
KeyCodeESCKeys = False
End If
End Function
if-else ra na oi..yaw lisod-lisoda ang students kay maglabad ang ulo..basin mo-quit unya ug programming..hehehe..
Pwede ra pud i handle nimo ang keypress nga event sa imo textfield control. Then you filter out ang di nimo nahan nga character..![]()
adto ni sa event nga change sa text1 i bugang
if not isnumeric(me.text1.text) then
msgbox "invalid input"
me.text1.selstart = 0
me.text1.sellenght = len(me.text1.text)
exit sub
end if
as i remember sauna kung gusto nimo na number ra gud imo ma input ana.. i check nimo upon onkeypress event. if naka familiar ka an keyascii naa na sya equivalent from 0-9 then mao rato imo condition ana.
something like
IF keyascii>=47&& keyascii <=56 THEN
not sure basta ingon ana to
try ni nga code bro sa imo textbox keypress..Code:if Keyascii>=vbkey0 and keyasii<=vbkey9 then keyascii=keyascii else keyascii="" endif
Similar Threads |
|