|
-
Aug 12th, 2000, 03:31 PM
#1
Thread Starter
Addicted Member
How do you align the caption of the form on the title bar to the right rather the left?
-
Aug 12th, 2000, 03:34 PM
#2
Monday Morning Lunatic
With difficulty. You'll need to get the non-client area DC and paint it yourself.
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 12th, 2000, 04:31 PM
#3
transcendental analytic
You could make a fake-titlebar with a label, which you set align to the right
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 12th, 2000, 04:35 PM
#4
Monday Morning Lunatic
I'll post an example project in a few minutes.
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 12th, 2000, 04:36 PM
#5
Or you could just space the title over.
-
Aug 12th, 2000, 04:38 PM
#6
Monday Morning Lunatic
Until the user resizes the form .
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 12th, 2000, 05:20 PM
#7
it might take a while, but you could write a little function that adds spaces to the title bar depending on the width of the form,
I tried it for about 5 min. but I gave up... not cuz its too hard, but because um.... too lazy
-
Aug 12th, 2000, 05:40 PM
#8
Addicted Member
ok in my VB i can use:
Code:
Form1.RightToLeft = True
and this works great, coz in my language we start writing from right to left, not like english, thats why we use this...don't u have these property in ur VB???
-
Aug 12th, 2000, 05:45 PM
#9
Monday Morning Lunatic
On my UK English machine, it has the property, but is set to False by default. If I then change it to True, it instantly changes back to False. Bit annoying really.
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 12th, 2000, 05:55 PM
#10
Monday Morning Lunatic
Here's a very rough example, which demonstrates right alignment of the title, and it's the same example I'm using for another thread, so it has some extra bits in:
http://www.parksie.uklinux.net/newtitle.zip
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 12th, 2000, 05:55 PM
#11
Addicted Member
actually this is what should happen, coz your version doesn't support RightToLeft property, coz u only use English in ur windows, but my version supports Arabic and English, thats why it works here, but if u have any another version Which support RightToLeft then it will work, i think Arabic, Hebrew, Urdo and Persian the only languages which write from Right to left, and i think in thses versions of windows u have every thing twice, i mean like Text Boxes and Combo Boxes and every thing, one of then left to right, and the other is right to left, and u have defferent DLL files for every one of them, or defferent call, i don't know but this is what i think....
-
Aug 12th, 2000, 05:56 PM
#12
Monday Morning Lunatic
I think that the same controls just support the extra property, then display the text in a different way. The change is probably somewhere else in Windows.
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 12th, 2000, 06:24 PM
#13
Thread Starter
Addicted Member
Thanks for replying. I am not looking for right align. I want to be able to place text on the left, center, and the right. I used space(20) but one different computer it comes out different.
Any ideas?
-
Aug 12th, 2000, 07:41 PM
#14
You can use a PictureBox in place of the TitleBar.
Code:
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const SC_MOVE_EX = &HF012
Const WM_SYSCOMMAND = &H112
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
ReleaseCapture
SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MOVE_EX, 0
End If
End Sub
-
Aug 13th, 2000, 02:15 PM
#15
Thread Starter
Addicted Member
You code didn't do anything Megatron or am I running something wrong.
Thanks Megatron.
-
Aug 13th, 2000, 03:13 PM
#16
The code uses a PictureBox as a Titlebar. Set the Form's Caption to a blank string and set the ControlBox to False. Add a Picturebox to the Form, set the Align to 1-Align Top and then try it.
-
Aug 13th, 2000, 05:10 PM
#17
Monday Morning Lunatic
Change the constants to:
SC_MOVE_EX = 2
WM_SYSCOMMAND = &HA1
This should do it.
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
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
|