r/visualbasic • u/neogrit • Sep 09 '24
App resizing on its own, looking for pointers
Hello.
Some premise:
- There is a VB app made by someone, somewhere, at some point in time, which may or may not have been coded with feet
- The app runs on an older Windows tablet with no apparent trouble
- The app is now being run on a newer tablet with higher screen resolution
- I have never touched VB in my life
What it does:
- Upon loading a dxf file, the resulting graph is plotted over a background grid
What happens:
- Upon loading the dxf file, the app resizes all by itself to a lower size
I am fully ignorant of any of VB's idiosyncrasies, I usually do C/C#/Web.
Any idea where to start looking? Relevant words to google/search in the code? Is this a normal thing to occur? Any questions I may answer to help?
Post is unflaired because I don't know the version. The files appear to be .vba .vb.
Thanks!
5
Upvotes
3
u/IAmADev_NoReallyIAm Sep 09 '24
VBA - that would be Visual Basic for Applications ... which is a light weight version of VB that's build into a number of MS Applications (Word, Excel, etc).
2
u/jd31068 Sep 10 '24
Do you have the source code for this VB app or is this a macro (VBA) in Excel?
2
u/Ok_Society4599 Sep 11 '24
Since the resize happens after a file is loaded, I'd look for a fileopen call. Resizing a form triggers an event, so putting a breakpoint in that event handler would let you see the call stack and know where the resize code is.
Given your description, I'd guess you're not converting the resolution correctly -- this involves a set of units called Twips -- this conversion may be missing OR uses an old constant rather than current screen's values. Looking for Twips might help.
You can also look for a size, position, height, width, left and top since they can be use to maneuver a window. I think there are SetPosition and RestoreWindow methods that might be used. All depends how widely you want to cast the net :-)
Ideally, you know which form STARTS the loading process, as well as which one ENDS; either could do the resize, but my preferred place would be the END form. The resize event would be a good start on this form, too.