[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Form Resize Max - Sub Classing problem

Posted on 2005-04-08
8
Medium Priority
?
281 Views
Last Modified: 2010-05-02
I need to prevent a form from becoming TOO big. The form is a borderless form.

Using SubClassing, I can control the size of a form that has a borderstyle of SizeAble....

However, using the code here: http://support.microsoft.com/kb/q185733/ , a borderless form does not respond to the subclassing procedure.

What I'm looking for here is a way to prevent a borderless form from covering the taskbar when maximized. Regular subclassing will not accomplish this. What makes a borderless form different from a sizeable one, other than the border style?

I'm aware of a bug in VB that will cause borderless form to always cover the taskbar, but that is an old bug and I'm using XP with Visual Studio SP6. I would figure that bug should be fixed by now.

Using the code in the link above, can anyone here find a way to maximize a borderless form and not have it cover the taskbar???

Mugman

P.S. A quick and good answer will be boosted to 500 (2000) points.
0
Comment
Question by:mugman21
  • 4
  • 4
8 Comments
 
LVL 32

Accepted Solution

by:
Erick37 earned 2000 total points
ID: 13735235
Instead of Maximizing the form, could you just use the Move() method to make the form as large as the screen?
0
 
LVL 8

Author Comment

by:mugman21
ID: 13735478
Erick37,

Thanks for making me feel dumb.... Never thought of that.... I have a usercontrol manipulating a form, I forgot I could extend the move method threw the parent property......

Problem solved, at least well enough....

I'll go ahead and give you credit here, but if you have a little spare time could you figure out why the borderless form thing listed above doesn't work?

Mugman
0
 
LVL 32

Expert Comment

by:Erick37
ID: 13735880
I just tried the code on a borderless form, and it seems to work fine.  I am resizing the form using:
Call SendMessage(Me.hWnd, WM_NCLBUTTONDOWN, HTBOTTOMRIGHT, ByVal 0&)
and the subclassed form obeys the limits set in the MINMAXINFO structure.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Author Comment

by:mugman21
ID: 13736255
really, that is interesting....

I was trying using VB's built in functions to resize (windowstate =2 or 0), it failed. Never tried it with the sendmessage function...

What happens if you try the windowstate prop.?
0
 
LVL 32

Expert Comment

by:Erick37
ID: 13736464
It works using the Windowstate as well.

Maximized (2), it goes upper left at the limited size
Restored (0), it restores to the previous size and location.

Perhaps try your code on a normal window to see if there is not something wrong in the subclassing code.
0
 
LVL 8

Author Comment

by:mugman21
ID: 13736524
I've tried the above subclass routine.... If the form is set to sizeable, it works great. Once I set it to borderless or a dialog form, the above subclass routine no longer functions (setting it to borderless at designtime).....

I'm using XP home edition, VS service pack 6, what are you using? This isn't making sense
0
 
LVL 32

Expert Comment

by:Erick37
ID: 13736566
XP Pro SP2
0
 
LVL 8

Author Comment

by:mugman21
ID: 13736641
Ok, I'm going to test on a different machine with XP sp2 PRo. As I noted in the initial question, I am aware of a bug that will cause this behavior, but that bug is almost 5-6 years old. With the release of Xp and VS sp6, I would of figured the bug would be gone!!!!!! Perhaps this is yet another example of M$ dragging their as*'es.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month20 days, 14 hours left to enroll

810 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