xsharp.eu • Dialog size behaviour: VO dialog appears narrower (only width!) in X#
Page 1 of 4

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Mon Jul 17, 2023 1:55 pm
by stefan.ungemach
I have a strange issue regarding the display of dialogs: On the same machine a dialog with the same size (proven by a debugview output immediately before the Show) of 118x146 pixel looks different in VO and X#:

Visual Objects (correct):

 
dialogVO.png
dialogVO.png (2.07 KiB) Viewed 1019 times
XSharp:

 
dialogXsharp.png
dialogXsharp.png (2.73 KiB) Viewed 1019 times
Since the controls are clipped it is obviously not a scaling problem. It's also confusing that there is only a width difference.

If I set the size manually to something bigger directly before the show for measurements, the controls have the same size on both dialogs. Only the X# dialog is drawn smaller than coded.

There is no window editor involved, everything is generated by code.

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Mon Jul 17, 2023 3:28 pm
by robert
Stefan,
This looks like the manifest for "XP styles" was not included in your app.
Please choose the "suppress default win32 manifest" on the application properties page, and add the manifest from your VO program as resource to your project.

Robert

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Tue Jul 18, 2023 8:32 am
by stefan.ungemach
Thank you. How exactly would I do that (I can i.e. add a "native resource template (rct)", or an xml file where I could put the contents of my resource XML from VO into)?

Is it possible to do it once (in an assembly) fr all projects which use it instead of adding it seperately to each project?

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Tue Jul 18, 2023 8:52 am
by stefan.ungemach
Addition: in VO I have

RESOURCE CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST %executabledir%adkomm.man

in one of the framework libraries. In X# I added a new resource "manifest.rc" and put this in it:

CREATEPROCESS_MANIFEST_RESOURCE_ID RC_RT_MANIFEST "B:adkomm.man"

Unfortunately it doesn't change anything. Is there something I'm missing, and how could I verify the success?

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Tue Jul 18, 2023 8:55 am
by robert
Stefan,
- Create a new app from the VO MDI template
- This contains a file cctl6.man
- It also contains Standard Shell.Manifest.rc
- copy these to your project folder
- Include both in the project. Make sure that the item type for the RC file is a "NativeResource"
- The resource file assumes that the manifest is in a resources folder. If you put it in the same folder, then adjust the contents of the rc file.

Of course, you can put these in a shared folder, shared by all of your apps.
If you want to automatically include it in all of your apps then you would have to make a common file that is included in each project file.
An alternative is to create a Directory.Build.Props or Directory.Build.Targets file in the root of your solution. The contents of these files is automatically included by MsBuild.
I think a props file would work. See
https://thomaslevesque.com/2017/09/18/c ... ild-props/
for more info

Robert

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Tue Jul 18, 2023 10:30 am
by stefan.ungemach
Robert,

I've tried this. Here is my project:
 
Untitled.png
Untitled.png (5.62 KiB) Viewed 1018 times
The cctl6.man is copied from the new VO MDI App. The Manifest.rc has the same contents as Standard.Shell.Manifest:
​​​​​​​ 
Untitled2.png
Untitled2.png (72.21 KiB) Viewed 1018 times
The results are still the same. I'm sure I missed something stupid, but I don't have a clue...

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Tue Jul 18, 2023 10:32 am
by robert
Stefan,
Please do not embed images in the messages, but use attachments.
There is something broken with the website. We will look at that asap.
But right now we cannot read your message

Robert

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Tue Jul 18, 2023 11:51 am
by stefan.ungemach
Project with manifest.png
Project with manifest.png (74.58 KiB) Viewed 1018 times

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Tue Jul 18, 2023 11:53 am
by stefan.ungemach
Project settings.png
Project settings.png (78.98 KiB) Viewed 1018 times

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Posted: Tue Jul 18, 2023 12:29 pm
by leon-ts
Stefan,
This is not the full version of the manifest. I'm not sure if the manifest is actually causing the problem you describe, but if it is, try this manifest (just replace the description and app version with yours):
Example.man.zip
(806 Bytes) Downloaded 108 times