@melwired: paggamit nalang ug combo box then in design-time, butangi daan ug duha ka entry sa list which is "CASH" OR "CREDIT"...that way dropdown box nalang ka ...wa nay type2x...
![]()
@melwired: paggamit nalang ug combo box then in design-time, butangi daan ug duha ka entry sa list which is "CASH" OR "CREDIT"...that way dropdown box nalang ka ...wa nay type2x...
![]()
bitaw melwired, i combo box, checkbox or option box nalang na... ngano imo paman gyud i textbox? ipa textbox gyud na sa inyong sir?
bro mo comment lang ko gamay ha?Originally Posted by melwired`
ur referring to a keypress = 13 w/c i think an enter key ayt? what if the user does not hit the enter key maybe naay problem dba?
pwede ghapon imo code bro maybe u should also consider add the lost_focus event of the textbox so that doble imong trapping sa string nga imong gi required and also it is nice daw na when declaring variable string should be lyk Dim Str as string kay ang single character is intended for declaring integer variable pero in reality anything will also be possible
on textbox lost_focus event:Code:private sub txtterms_keypress(keyascii as integer) dim str as string str = "cash" select case index case 13 ' this is to trap every letter on txtterms.text that matches cash if rtrim(txtterms.text) <> str then MsgBox "pls input cash", vbinformation, app.title txtterms.setfocus exit sub end if end select
Code:select case index dim str as string str = "cash" case 0 ' index of ur textbox if rtrim(txtterms.text) <> str then MsgBox "pls input cash", vbinformation, app.title txtterms.setfocus exit sub end if end select
bro, in your form1 put a textbox named text1
code:
Add module1Option Explicit
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim x As Byte
x = Text1.SelStart + 1
If KeyAscii <> 8 Then
Select Case x
Case 1
If Chr(KeyAscii) <> "c" Then KeyAscii = 0
Case 2
If Chr(KeyAscii) <> "a" Then
If Chr(KeyAscii) <> "r" Then
KeyAscii = 0
Else
xCash = False
End If
Else
xCash = True
End If
Case 3
If xCash = True Then
If Chr(KeyAscii) <> "s" Then KeyAscii = 0
Else
If Chr(KeyAscii) <> "e" Then KeyAscii = 0
End If
Case 4
If xCash = True Then
If Chr(KeyAscii) <> "h" Then
KeyAscii = 0
Else
xCredit = False
End If
Else
If Chr(KeyAscii) <> "d" Then
KeyAscii = 0
Else
xCredit = True
End If
End If
Case 5
If xCredit = True Then
If Chr(KeyAscii) <> "i" Then KeyAscii = 0
Else
KeyAscii = 0
End If
Case 6
If xCredit = True Then
If Chr(KeyAscii) <> "t" Then KeyAscii = 0
Else
KeyAscii = 0
End If
Case Else
KeyAscii = 0
End Select
End If
End Sub
code:
try it.Option Explicit
Global xCash As Boolean
Global xCredit As Boolean![]()
master.....Originally Posted by godCode
dili gyud mo magmahay basta si godCode na ang mocheck sa inyong code..the callsign speaks for itself..master!!!
sus pa humble humble pa gyud ning si digitalsuperman uy... ikaw raman worthy na matawag ug master sa programming... naningot man gani to si sir pag defend nimo kay sobraan naka ka ngilngig... hadlok siya na ma system failure tong iyang as400 tungod sa ka elite sa imong gipang code...Originally Posted by digitalsuperman
hahaha..ahak oi..Originally Posted by godCode
bay ok ra kong magpatabang ka. Ayaw lang ana nga mobayad ka para lang mahuman imo project. Ikaw raman gihapon ang makat-on ana. Unya kng pangutan-on kay about sa imo prog magnganga lang kay di man ikaw naghimo sa prog. And also dili ra imo name ang imo gidala hasta pod ang name sa school. I am also from UC.Originally Posted by melwired`
Mura di man guro lisod gyod kaayo ang gipahimo ni sir, I've been there. Research lang gyod. Daghan gyod kaayo materials sa internet or sa library. Layo pa bitaw pud ang ang end sa semester. Kaya ra na nimo.
No pain, no glory................
MaskEdit nga component nalang para sa pag input ug numbers
then sa terms kay option button pwd na.
I think the best way to fix this problem is to use combo box...
why scrable with very long codes if there is avialable usable control.
Similar Threads |
|