|
-
Jun 13th, 2013, 03:34 AM
#1
Thread Starter
Enjoy the moment
[RESOLVED] menu editor from right to left
hey
i created a popup menu in my form
is there a way when i right click it will show me the text from right to left?
now it shows from left right by defualt
tnx for the help
-
Jun 13th, 2013, 07:14 AM
#2
Re: menu editor from right to left
If you mean you want text to appear right aligned then probably NO.
You may instead design your own form and show it on right click instead.
-
Jun 13th, 2013, 07:33 AM
#3
Re: menu editor from right to left
... or you just have to search for the correct words.
Look at Post #3
http://forums.codeguru.com/showthrea...u-to-the-right
Code:
private Declare Function GetMenu Lib "user32" (byval hwnd as Long) as Long
private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (byval hMenu as Long, byval nPosition as Long, byval wFlags as Long, byval wIDNewItem as Long, byval lpString as Any) as Long
private Const MF_BYPOSITION as Long = &H400&
private Const MF_STRING as Long = &H0&
private Const MF_RIGHTJUSTIFY as Long = &H4000
private Sub Form_Load()
Dim hMenu as Long
hMenu = GetMenu(me.hwnd)
' the second parameter in this example is the menu position...
'the first menu is at 0
Call ModifyMenu(hMenu, 3, MF_BYPOSITION Or MF_RIGHTJUSTIFY, MF_STRING, "&Help")
End Sub
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jun 13th, 2013, 08:00 AM
#4
Thread Starter
Enjoy the moment
Re: menu editor from right to left
 Originally Posted by RhinoBull
If you mean you want text to appear right aligned then probably NO.
You may instead design your own form and show it on right click instead.
exactly
-
Jun 13th, 2013, 08:06 AM
#5
Thread Starter
Enjoy the moment
Re: menu editor from right to left
it dont work
beacuse i made the rightclick not visible in the form
with a popup menu
Code:
Private Sub Form_Load()
Dim hMenu As Long
hMenu = GetMenu(Me.mnuRightClick)
' the second parameter in this example is the menu position...
'the first menu is at 0
Call ModifyMenu(hMenu, 3, MF_BYPOSITION Or MF_RIGHTJUSTIFY, MF_STRING, "&Help")
-
Jun 13th, 2013, 08:08 AM
#6
Thread Starter
Enjoy the moment
Re: menu editor from right to left
rhino do you have skype ?
beacuse i cant send you message here
i need to ask you something
-
Jun 13th, 2013, 08:13 AM
#7
Re: menu editor from right to left
Your error is the GetMenu-Line. You have to leave that one as it is in the sample.
I've marked something red in the code. This is where you have to select which menu to change with 0 being the first menu in the menubar (The "3" was just an example)
Code:
private Declare Function GetMenu Lib "user32" (byval hwnd as Long) as Long
private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (byval hMenu as Long, byval nPosition as Long, byval wFlags as Long, byval wIDNewItem as Long, byval lpString as Any) as Long
private Const MF_BYPOSITION as Long = &H400&
private Const MF_STRING as Long = &H0&
private Const MF_RIGHTJUSTIFY as Long = &H4000
private Sub Form_Load()
Dim hMenu as Long
hMenu = GetMenu(me.hwnd)
' the second parameter in this example is the menu position...
'the first menu is at 0
Call ModifyMenu(hMenu, 3, MF_BYPOSITION Or MF_RIGHTJUSTIFY, MF_STRING, "&Help")
End Sub
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jun 13th, 2013, 09:32 AM
#8
Thread Starter
Enjoy the moment
Re: menu editor from right to left
-
Jun 13th, 2013, 09:37 AM
#9
Re: menu editor from right to left
It's the position of the menu with 0 being the first, like in this example:
0 - File
1 - Edit
2 - View
3 - Extras
4 - Help
and so on.....
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jun 13th, 2013, 09:44 AM
#10
Thread Starter
Enjoy the moment
Re: menu editor from right to left
do i put this in a module?
Code:
private Declare Function GetMenu Lib "user32" (byval hwnd as Long) as Long
private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (byval hMenu as Long, byval nPosition as Long, byval wFlags as Long, byval wIDNewItem as Long, byval lpString as Any) as Long
private Const MF_BYPOSITION as Long = &H400&
private Const MF_STRING as Long = &H0&
private Const MF_RIGHTJUSTIFY as Long = &H4000
-
Jun 13th, 2013, 09:45 AM
#11
Re: menu editor from right to left
Yes, but instead of "private" declare it "public"
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jun 13th, 2013, 11:08 AM
#12
Re: menu editor from right to left
 Originally Posted by salsa31
rhino do you have skype ?
beacuse i cant send you message here
i need to ask you something
This is public forum so please ask here.
-
Jun 13th, 2013, 11:49 AM
#13
Thread Starter
Enjoy the moment
Re: menu editor from right to left
-
Jun 13th, 2013, 11:55 AM
#14
Re: [RESOLVED] menu editor from right to left
So the code i found worked?
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Jun 13th, 2013, 12:00 PM
#15
Thread Starter
Enjoy the moment
Re: [RESOLVED] menu editor from right to left
nope but tnx for the help
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
|