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

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!
brucesilverAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EnladeCommented:

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
EnladeCommented:

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
brucesilverAuthor Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Bob LambersonSoftware EngineerCommented:
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
brucesilverAuthor Commented:
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
Bob LambersonSoftware EngineerCommented:
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
brucesilverAuthor Commented:
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
SCDMETACommented:
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
brucesilverAuthor Commented:
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
SCDMETACommented:
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
brucesilverAuthor Commented:
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
SCDMETACommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EnladeCommented:

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.