|
-
Aug 6th, 2000, 05:04 AM
#1
Thread Starter
Lively Member
Hi! I am experiencing a lot of troubles with a program of mine. I have used in this program a pair of textfield, setting "Alignment" property to RightJustify for each one. On my PC everything works well, all texts are aligned on the right side, but, on other computers, each textfield becomes aligned on the left. What could the problem be given by? Maybe it is OS dipendent? Maybe i forgot any DLL in the package?
Thanks.
-
Aug 6th, 2000, 08:28 AM
#2
Monday Morning Lunatic
It could be a problem with language settings (reading R2L and all that).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 6th, 2000, 08:40 AM
#3
I've had this problem before, too (it worked on Win 95 but not 98, or vice-versa, I don't remember which). But anyway, the problem boils down to this:
According to MS, the Alignment property of a TEXTBOX control only has effect when its MULTILINE property is set to true - otherwise, the text will always be aligned LEFT (as we've seen, it doesn't always happen that way, but this is the way it is documented).
In short, for your program to work on different computers with different OS's, change the Multiline property of these textboxes to True.
"It's cold gin time again ..."
Check out my website here.
-
Aug 6th, 2000, 08:48 AM
#4
Thread Starter
Lively Member
Ok thanks! I'll trying doing so... (but that's really
stupid! Why did MS implement it this way... bha!). Thanks a lot!
-
Aug 6th, 2000, 09:02 AM
#5
To make multiline TextBox act like a non-multiline TextBox, insert this code into the KeyPress event.
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
'Set KeyAscii to 0
If KeyAscii = 13 Then KeyAscii = 0
End Sub
-
Aug 6th, 2000, 09:06 AM
#6
Thread Starter
Lively Member
Hi Megatron,
The problem is that i have already used keypress to manage
some keyboard events, so i cannot use it this way; isn't it
the same thing if I set the MaxLenght property to the total
number of chars in a single-line-length?
Thanx
-
Aug 6th, 2000, 09:08 AM
#7
Monday Morning Lunatic
No. Megatron's code prevents you from typing a return (ASCII 13) into the text box. It doesn't limit the TOTAL number of characters.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 6th, 2000, 09:14 AM
#8
Thread Starter
Lively Member
Well, you're right! But I have already assigned to the enter
key another function (i.e. evaluating an expression) linking that to a button (i.e. the =). Is the problem solved this way?
-
Aug 6th, 2000, 09:19 AM
#9
You can do both.
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
'Prevent Enter from being pressed
KeyAscii = 0
'Call your sub
Call MySub
End If
End Sub
-
Aug 6th, 2000, 09:27 AM
#10
Thread Starter
Lively Member
OK!
Ok, i'll do that this way! Thanks a lot!
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
|