pernah njumpain nggak, klo kmu nyetting Combo1.style mu = dropdown list? pasti pernah nemuin error klo misal kmu mo nge-clear dgn set combo1.text = "" akan ngebangkitin error "Text Property is Read-Only!" Iya kan? Bahkan buku (CHM) Programming Microsoft Visual Basic 6.0 aja jg bilang gak nganjurin pemakaian Combo.Style = Dropdown List.
Quote: |
Drop-down list controls pose special problems in programming. For example, they never raise Change and keyboard-related events. Moreover, you can't reference all the properties that are related to activity in the edit area, such as SelStart, SelLength, and SelText. (You get error 380—"Invalid property value.") The Text property can be read and can also be written to, provided that the value you assign is among the items in the list. (Visual Basic performs a case-insensitive search.) If you try to assign a string that isn't in the list, you get a run-time error (383—"Text property is read-only"), which isn't really appropriate because the Text property can sometimes be assigned). |
... makanya banyak yg milih data-combo (bound-control)... tapi pemakaian data-aware control bukan menyelesaikan masalah, tp banyak masalah2 lain yg bermunculan... salah satunya adalah dgn konsistensi data, memory leak, sampe yang kethok motho kya ngga bs di-apply nya XP Manifest ke component slain Windows Common Controls...
sekarang, PROBLEM SOLVED! aku kembali makae combo. Ngga pake2 lg data-combo. ngga pake2 lg Microsoft Forms 2.0 Combo. ngga pake2 lagi Data Combo nya ComponentOne...
untuk nge-reset property text jadi kosong, sebagaimana text1.text = "", aku kini makae combo1.listindex = -1
... alhamdulillah ...
NB : konsep ini berlaku untuk *semua* jenis combobox di semua environment Win32, mulai dari VB, Delphi, hingga komponen2 combo yang aneh2... karena pada dasarnya mreka mbikin component combo semuanya inherits dari native combobox.
6 comments:
tes
thanks so much....
makasih bgt om ..ilmunya
sangat membantu. tq gan
sumpah deh sangat membantu hahaa
thanks gan...
Posting Komentar