|
-
Mar 13th, 2004, 01:22 PM
#1
Thread Starter
Hyperactive Member
TextBox bug?
Add a textbox to a form, set it to multiline and disable it (enabled = false). Change the alignment during run-time using the code below.
VB Code:
Text1.Alignment = vbRightJustify
On mine VB dies and I just updated it to SP5 thinking that would rectify the problem - it didn't. Applications compiled with this code also crash out.
Just curious if anyone has come across this before and if they found a work-around, or not.
-adehh
-
Mar 13th, 2004, 01:32 PM
#2
Member
Hi,
I had this problem and I couldn't find a solution. I ended up just using the RichTextBox control instead. This does all that text box does and more.
Robin
-
Mar 13th, 2004, 01:37 PM
#3
Thread Starter
Hyperactive Member
That is not an option, I tend to avoid dependancy files as much as possible and plus the textbox holds around a max of 12 characters which would be a waste of the richtext anyway.
-adsehh
-
Mar 13th, 2004, 01:39 PM
#4
Frenzied Member
Doesnt crash on me in debug or run mode from within VB. Also,
Text1.Alignment = 1
Also works fine for me.
-
Mar 13th, 2004, 01:44 PM
#5
Thread Starter
Hyperactive Member
What version of VB are you running?
-
Mar 13th, 2004, 01:53 PM
#6
Frenzied Member
-
Mar 13th, 2004, 03:09 PM
#7
Supreme User
.....No crashes either here mate
-
Mar 13th, 2004, 04:17 PM
#8
I crashed on XP Pro (sp5) but not on Win98 (which does not have any service packs).
Does the OS make a difference?
-
Mar 13th, 2004, 04:27 PM
#9
Supreme User
oh, and i am ussing Winmdws 98 SE
-
Mar 13th, 2004, 05:01 PM
#10
Thread Starter
Hyperactive Member
It's beginning to look like OS does make a difference. There's 2 cases now where 98 hasn't crashed, I'm running 2k and it crashed out both on SP5 and normal, that's VB enterprise.
-adehh
-
Mar 13th, 2004, 06:02 PM
#11
Frenzied Member
-
Mar 13th, 2004, 06:31 PM
#12
Fanatic Member
I'm running WinXP Pro and I also get the same error. However, if I programmatically disable the textbox after setting the text alignment it works fine. Is that an option for you?
Author for Visual Basic Web Magazine
-
Mar 13th, 2004, 06:51 PM
#13
Locking the textbox rather than disabling it at design time also works. Another, perhaps better, option is to put the textbox in an invisible frame and disable the frame rather than textbox. If you choose the latter approach you can set the textbox's ForeColor to "Disabled Text" to make it look like it's disabled.
-
Mar 13th, 2004, 07:24 PM
#14
Thread Starter
Hyperactive Member
I ended up getting round it by using a label. I thought I needed use of the textheight function but recently found out that I don't so I'm not using the textbox anymore.
Still interested as to why this bug only affects some people though.
Cheers for all the replies, adehh.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|