Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Controls in WinXP Home sp2, Visual Basic sp6 not resizing properly

Posted on 2004-11-20
13
Medium Priority
?
330 Views
Last Modified: 2013-11-25
I have this frustrating problem with Visual Basic programs, both compiled and in the VB IDE, that are not rezising to fit the form to the right. Whether a statusbar, grid, textbox, whatever, controls do not fill the form and leave an un-drawn area to the right of the form. Even when drawing controls on the form the control does not draw up to the resize handles of the control. This occurs with all cmctl, all all thrid party controls as well.

This occured under XP sp1 and VB sp5 as well. Please help guys, this is driving me nuts!
0
Comment
Question by:brucesilver
  • 5
  • 3
  • 3
  • +1
13 Comments
 
LVL 7

Expert Comment

by:Enlade
ID: 12634413

You need to trap the resize event for the form and then resize each control within that event.  For instance, create a form and then put a textbox control on it (call it Text1).  Then add the following code to the form code and run.  Then resize the form and watch the textbox resize.

Private Sub Form_Resize()
  Text1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub
0
 
LVL 7

Expert Comment

by:Enlade
ID: 12634463

I'm assuming that I don't understand your problem, so it is unlikely that what I said above is a solution for you.  Still, I'm trying to get a code example that does not work for you so that we can analyze it for the solution.  So, lets start with the above.  Does it resize properly for you?

Note, you might want to subtract 100 so you can be sure that the lower right corner is not off the form.  But then don't shrink down your form to much for this test (unless you take it out or put in a limiter IF statement of some sorts).

Private Sub Form_Resize()
  Text1.Move 0, 0, Me.ScaleWidth - 100, Me.ScaleHeight - 100
End Sub
0
 

Author Comment

by:brucesilver
ID: 12634695
No, I don't think I am being clear. The problem has nothing to do with the rezise event. The controls refuse to draw in the IDE to fit the rezise handles of the control to the right. Also, when running, the controls do not fit the drawn boundaries of the control...just like in the IDE. The total width of the control is not being cut off by the right side of the form, the control itself is not drawing to fit it's prescribed boundaries. It's a strange problem. If you want to give me your mail address, I can send you a screenshot.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:Bob Lamberson
ID: 12636462
Can you describe what you mean in some different (simpler) terms, what you mean by

> ...... to fit the rezise handles of the control to the right.
and
> ......controls do not fit the drawn boundaries of the control.
and
>.......to fit it's prescribed boundaries?

sorry but I don't understand what the problem is.

Bob
0
 

Author Comment

by:brucesilver
ID: 12636588
On my machine there is a difference between the outer borders of the control and the part of the control that is actually being drawn. If I draw a Tab control on a form, all of the control is drawn except for a blank space on the right edge of the control. This blank space also has the color of the client area of the form and not that of the control. It is a completely void area.

I don't know how else to explain it. Within the boundaries of the control to the right edge of the boundary a small portion is completly void of any of the control...it's just a cut-off space. If anyone wants so give me an email address I will be glad to send a screenshot and make the problem prefectly clear.

Thanks...

0
 
LVL 12

Expert Comment

by:Bob Lamberson
ID: 12636653
Thanks for the explanation, that makes it clear what your problem is. Sure sounds like something in VB is corrupt. Have you tried completely uninstalling VB and reinstalling it?

Bob
0
 

Author Comment

by:brucesilver
ID: 12636677
Yes, I have tried and it still shows up. The problem occurs in the IDE and in compiled programs. Label controls work properly, and the prcturebox and image controls also draw right, but any grid control, statusbar, coolbar, tab, and others don't work. Strangely, treeview is drawn properly, but listview does not. Many third-part controls have the same problem, like the White Dolphin splitter control and the 10Tec igrid control.

I'm out of answers. I hope someone can finally end my pain...!
0
 
LVL 6

Expert Comment

by:SCDMETA
ID: 12636718
Is this problem reproducable on other machines, or is it limited to your machine?

If it is reproducable on on other machines, then I would assume it is in your code.  
a) Try creating a new project. Add a few controls. Do you see the problem?  
b) Do you use an special APIs?
c) Did you set an form attributes such as clip controls?

If the problem is not reproducable on other machines, then look at your environment.  
a) Do you have a weird resolution?  
b) Try a different resolution

Good luck
0
 

Author Comment

by:brucesilver
ID: 12636763
a) Try creating a new project. Add a few controls. Do you see the problem?  
  Yes, this occurs in every project.

b) Do you use an special APIs?
  The problem occurs in projects with only one form and no declarations of any kind.

c) Did you set an form attributes such as clip controls?
  Occurs whether clipcontrols is True or False.

If the problem is not reproducable on other machines, then look at your environment.  
   Please let me know what I should be looking for. I'll try anything!
  I have not been able to reproduce it on other machines running XP

d) Do you have a weird resolution?  
  No, usually 800x600, but I have gone through other resolutions and it still shows up.

e) Try a different resolution
  Done, but with no results.
0
 
LVL 6

Expert Comment

by:SCDMETA
ID: 12636924
OK...so we have
1) a problem that is specific to your machine.
2) happens in even the simpliest of VB applications
3) is not related to clip controls
4) does not seem to be related to resolutions

Try the following:
a) Set your Display Settings | Appearance to "Windows Standard" (or something other than what you have select now).  
Does this correct the problem?

b) Boot your OS in safe mode (press and hold F8 during startup) .  This might elimate any special configuration, drivers, etc that might be causing the problem.  Do this correct the problem?

c) Also, try "VGA mode".  Do this correct the problem?

Did this problem just occur one day?  If so, can you remember what you might have installed or changed that caused it to occur?
0
 

Author Comment

by:brucesilver
ID: 12639322
Yes, I tried again to change the display setting...no change. I booted into safe mode. There is still no change. VGA mode also did not correct the problem.

I have racked my brain to try and remember what I installed, or what changed on the system at the time this happened. I ignored it at the time because I was not using VB much. Now I can't seem to remember any one thing I installed that might be causing this. At first I thought it started occuring around the time I installed sp6 for VB, but I uninstalled that, went back to sp5, with no results.

I know...almost always you can retract your steps to reverse engineer the whole thing, but this is one of those cases where you can't. I thought I might be able to find on some message board somewhere someone talking about this problem and getting the solution, but I can't find anyone else out there talking about it.

Any more suggestions would be much appreciated.

Bruce

0
 
LVL 6

Accepted Solution

by:
SCDMETA earned 400 total points
ID: 12639538
OK, you have pretty much ruled out it being related to resolution and display settings.

1) Create a brand new project.
2) Place one control on it that experiences the problem. (I will use  SSTab control.)
3) Compile the project to an exe.  This is your test case.

4) Go to www.sysinternals.com
5) Click Windows NT/2K/XP/2K3 Utilities
6) Download ProcessExplorer (http://www.sysinternals.com/ntw2k/freeware/procexp.shtml)
7) Unzip ProcessExplorer into a directory (c:\Program Files\Sysinternals\ProcessExplorer)
8) Run ProcessExplorer
9) Run your Project
10) Find and select your project in ProcessExplorer.
11) You should get a list of dlls that your project is using.
12) Compare these files to similiar files running on a working system.

I would recommend uninstalling VB completely and reinstalling, but I don't think all the dlls would uninstall.  The above suggestion will get you a small list of dlls/ocx to experiment with.

Good Luck
0
 
LVL 7

Expert Comment

by:Enlade
ID: 12639643

This is not likely a coding problem and since it seems to be having similar problems with third party controls it might not even be a problem with the controls files either.  It might be a problem with your windows system files in general.  If you nohing anyone suggests works, as a last resort, reinstall windows and reinstall VB and service packs.  As a second to last option run windows repair (rather then reinstalling it).

Personally, I would just reinstall windows before I wasted any more time trying to figure out the problem.  Sometimes it just pays to reinstall windows rather then try to get inside the heads of Microsoft OS Developers.  All things lead to Microsoft....in the same way that all things lead to entropy.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question