Bug VB6.0... T_T

Salam...

Duk buat2 VB ni, nak set MaxLength textbox=0 supaya user tak boleh masukkan sebarang data but tak boleh. User still boleh masukkan data. Pening.... search punye search tengok2 ini adalah bug VB6. Bila MaxLength=0, it means no limit. Erkkkk....

Adussss...sila baca di bawah... now what? Disable textbox?

"http://support.microsoft.com/default.aspx?scid=kb;en-us;285932"
=======================================================
SYMPTOMS
When the MaxLength property of a TextBox control is set at design time, and the Alignment property of the control is changed at run time, the MaxLength value is ignored.
RESOLUTION
To work around this problem, reset and assign the MaxLength property at run time. See the code sample in the "More Information" section.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
MORE INFORMATION
Steps to Reproduce Behavior
1. Create a new standard EXE project in Visual Basic. Form1 is created by default.
2. Add a TextBox control to Form1.
3. Set the MaxLength property of the TextBox control to 1.
4. Paste the following code into the code window of Form1:Private Sub Form_Load()
Text1.Text = ""
Text1.Alignment = 1
' To work around this bug, uncomment the following two lines of code.
' Text1.MaxLength = 0
' Text1.MaxLength = 1
End Sub

5. Press the F5 key to run the program.
6. Type multiple characters in the TextBox control, and notice that the MaxLength property is ignored.
NOTE: This bug does not occur in Visual Basic 5.0 because the Alignment property is read-only at run time.

--------------------------------------------------------------------------------
APPLIES TO
• Microsoft Visual Basic 6.0 Professional Edition
• Microsoft Visual Basic 6.0 Enterprise Edition
=========================================================


Comments

Post a Comment

Popular Posts