ComboBox İçine Müdahele Ettirmemek

ComboBox içine veriyi, AddItem ile yada herhangi bir db den veri çekerek doldurduğumuz durumlarda, kullanıcı tarafından veri yazılmamasını istersek şayet….


Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

If KeyCode = 8 Or KeyCode = vbKeyDelete Then
KeyCode = 0
End If

End Sub

 

ve…..


Private Sub ComboBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

KeyAscii = 0

End Sub

 

Neden KeyPress ve KeyDown’a ayrı ayrı kod yazıldı ehli anlar. 🙂

Paylaşmayı unutmayın!
0 0 votes
Article Rating
Subscribe
Bildir
guest
0 Yorum
Inline Feedbacks
View all comments