change pushButton Icon position |
Post Reply |
Author | |
yair-edsoft
Newbie Joined: 14 April 2007 Location: Israel Status: Offline Points: 14 |
Post Options
Thanks(0)
Posted: 04 May 2007 at 9:11am |
hi all
if you are using RTL Lay out and want to change the posion of the icon to the right of the text,
(this code was written by codejock and it placed in one of the sampels "MultiLanguage Scribble")
Example:(Vb6.0)
copy this and add it to one of your modules
Const WS_EX_LAYOUTRTL = &H400000
Const WS_EX_NOINHERITLAYOUT = &H100000 Const GWL_EXSTYLE = -20 Const GW_CHILD = 5 Const GW_HWNDNEXT = 2 Private Declare Function InvalidateRect Lib "user32" (ByVal hWnd As Long, lpRect As Long, ByVal bErase As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long Public Sub UpdateRTLForSingelCtl(hWnd, bRTLLayout As Boolean)
Dim Old As Long Old = GetWindowLong(hWnd, GWL_EXSTYLE) SetWindowLong hWnd, GWL_EXSTYLE, IIf(bRTLLayout, Old Or WS_EX_LAYOUTRTL, Old And Not WS_EX_LAYOUTRTL) end sub
using the Code:
btn.icon=imag.Icons.GetImage(Id,0)
UpdateRTLForSingelCtl btn.hWnd,True
|
|
yair
|
|
Mika
Newbie Joined: 18 April 2007 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
hi yair, Thank you for your good advice! Do you have some idea to avoid this problem?
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |