In V8i, setting Application.height=0: Application.width=0 worked fine --> The application window displayed very small.
In CE U15 this is not happening. The display result is like this:
Is there a way to get same result as in V8i?
Hi Roald,
at first, please be aware this is general developers forum, not MicroStation one. I recommend to move it to MicroStation Programming forum. To move existing discussion, use More > Move tool available under your original post.
Also, please follow the best practices and share as much as possible information (preferably using standardized subject format). For the discussed issue, it can be important e.g. whether you try to change the size from within MicroStation or from outside.
Roald Tvedt said:In CE U15 this is not happening. The display result is like this:
I tried this code in the current CE U15.2
Public Sub ModifyAppSizeDialog() Application.Height = 0 Application.Width = 0 End Sub
and it seems it works fine:
Roald Tvedt said:The application window displayed very small.
I am curious about the reason why you need to set the window size this way? Why to e.g. (not) minimize the dialog to Windows taskbar?
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi, Jan.
Your code gives this result in my CE U15 configuration:
Could this be caused by any 3. party applications?
I have tried to delete all *.upf files without success,
I have also used different WorkSpace/ WorkSet configuration. Same result.
I do it this way to hide the application from users. Maybe there is a better way?
Roald Tvedt said:Your code gives this result in my CE U15 configuration:
I see an exclamation mark icon in Message Center. Does VBA reports some issue? When yes, try to search this forum whether it was discussed already.
Roald Tvedt said:I do it this way to hide the application from users. Maybe there is a better way?
What you try is to set a minimal windows size, which is not real "hiding".
It depend on context and application requirements: When MicroStation should be hidden completely, it leads more to idea to write independent application and to access MicroStation through COM / Interop interface. Or, from MicroStation VBA, it would be possible (but I did not try it) to call Win API to tell Windows to minimize MicroStation to task bar. I assume these tricks can be found in general VB/VBA forums.
I created an SR on this issue. The answer was:
I have tested the behavior and can confirm the values assigned for height x width cannot be set to 0, the minimum values I could achieve are 750 x 1024 (height x width in pixel). The same values I can reach if I manually resize the MicroStation application window to the minimum.
HI,
Roald Tvedt said:I created an SR on this issue. The answer was:
I do not believe it's correct, because it works just fine on my both computers, with CE U15 and U15.2 versions installed.
Anyway: You have not provided any detail about VBA error I asked in previous post. It can be related, or maybe not, but without knowing exact message, it's hard to say.
Regardless it works or not, as I mentioned earlier, in my opinion this approach is wrong. When you want to minimize MicroStation dialog (which I think is not good idea, when you run macro inside MicroStation), Windows API should be used, so the application is asked "from outside" by OS to be minimized. As far as I know, there is ShowWindow function available in Win32 API, but to call native functions from VBA is not simple (even when used quite often).
Jan wrote:
"Anyway: You have not provided any detail about VBA error I asked in previous post. It can be related, or maybe not, but without knowing exact message, it's hard to say."
The error is not related. It is simply a warning appearing when trying to unload a VBA that already is unloaded.
Jan wrote:Regardless it works or not, as I mentioned earlier, in my opinion this approach is wrong.
Wrong or not. I really don't care as long as it works. In CE v. 10.15.02.11 it does not Work, confirmed by Bentley Support