Change size of a custom page in Inno Setup
The following image shows the size of a standard custom page:
http://img232.imageshack.us/img232/8449/imagejp.png
I've intentionally removed the panel on top, where you usually see Caption
, Description
and Logo
. So you can see that the actual size of the page is quite small - there are gaps on top, left and right sides. Is there an开发者_StackOverflowy way to resize the page, so there are no gaps? I want the image to take the whole space.
I create the page using CreateCustomPage
function.
If you want complete control over one of the pages in an Inno Setup wizard, you'll need to use the CreateCustomForm
function instead of CreateCustomPage
.
As I mentioned in a comment, CreateCustomPage
retains the margins and other elements of the base template for a consistent look and feel. That's part of the charm to Inno Setup—how easy it is to create simple setup wizards with a standardized and nice-looking UI. If you're sure that you want to override this, however, it is indeed an option. CreateCustomForm
will allow you to lay out the form however you wish.
Remember that if you're creating your own welcome page, you'll probably also want to make sure that you've skipped showing the default welcome page!
So I have discovered this can be done quite easily:
// Create custom page
mainPage := CreateCustomPage(wpSelectTasks, '', '');
mainPage.Surface.Notebook.SetBounds(0, 0, WizardForm.ClientWidth, ScaleY(260));
But be aware this code affects other wizard pages as well, so you either need to change the notebook bounds to the old values when you switch pages, or you need to reposition controls on these affected pages (or skip them).
This SO answer is also changing bounds of wizard pages.
精彩评论