- This topic has 0 replies, 1 voice, and was last updated 2021-08-22 at 5:46 am by .
Viewing 0 reply threads
Viewing 0 reply threads
- You must be logged in to reply to this topic.
Home › Forums › Konopka Signature VCL Controls (formerly Raize Components) › TRzMenuController – UpdateMainMenuColor
Currently in 7.0 the procedure UpdateMainMenuColor assume fix that controller must be defined on the form. It’s too rigid.
I suggest the modification:
procedure TRzMenuController.UpdateMainMenuColor;
var
MenuInfo: TMenuInfo;
ownerForm: TCustomForm; //mod
begin
//mod if ( Owner <> nil ) and ( Owner is TCustomForm ) then
//mod begin
//mod if TCustomForm( Owner ).Menu = nil then
//mod Exit;
//mod end;
ownerForm := GetParentForm(Owner as TControl); //mod
if not Assigned(ownerForm) then exit; //mod
DeleteObject( FMainMenuBrushHandle );
if FUseMenuColorForMainMenu then
FMainMenuBrushHandle := CreateSolidBrush( ColorToRGB( FMenuColor ) )
else
FMainMenuBrushHandle := CreateSolidBrush( ColorToRGB( clBtnFace ) );
FillChar( MenuInfo, SizeOf( MenuInfo ), 0 );
MenuInfo.cbSize := SizeOf( MenuInfo );
MenuInfo.hbrBack := FMainMenuBrushHandle;
MenuInfo.fMask := MIM_BACKGROUND;
//mod SetMenuInfo( TCustomForm( Owner ).Menu.Handle, MenuInfo );
SetMenuInfo( ownerForm.Menu.Handle, MenuInfo ); //mod
end;
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Stripe is a payment processing platform that enables businesses to accept online payments securely and efficiently.
Service URL: stripe.com (opens in a new window)