VB simple addin

Hello

would someone would provide a simple code for an addin for VB which would create a button on the toolbar. When pressing on that button the currently active window would resize to maximum possible size, NOT like standard MAXIMIZE button.

Thx
EugeneSLOAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
DarthModConnect With a Mentor Commented:
PAQed with points refunded (500)

DarthMod
Community Support Moderator
0
 
JackOfPHCommented:
goto Project then select components...
On the selection choose... Micorsoft Window Common controls 6.0
Drag a toolbar on your form

Right click the toolbar then select properties...
CLick the Button Tab...

Add new button

On the form code... paste this code...

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Me.Width = 0
Me.Height = 0
End Sub
0
 
EugeneSLOAuthor Commented:
he he, I know about this
what I need is to create a VBAddin (like MZTools) which would resize the current window where I work.
Thx
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

 
danaseamanCommented:
Not sure if this will help.
There is an easier way to maximize all your code windows.
Just add this key to the registry. Next time you start a Vb6 project all the code windows will be maximized.:

HKEY_CURRENT_USER/Software/Microsoft/Visual Basic/6.0/MDIMaximized = "1"


http://www.gridlinx.com/annoy.htm
http://www.devx.com/vb2themax/Tip/18586
http://www.devx.com/tips/Tip/13025

0
 
EugeneSLOAuthor Commented:
I don't want them maximized as an usual maximized MDI window
I want to have the maximum possibile size in the MDIClient area of VB IDE, as you would resize from right-bottom corner by hand, NOT by pressing the maximize button from window caption.
0
 
EugeneSLOAuthor Commented:
ok, the problem is solved by myself
the code is something like this

Sub DoResizeWindow()
   Dim wnd As VBIDE.Window
   Dim hWndMDIClient As Long
   Dim rc As RECT
     
   
   hWndMDIClient = apiFindWindowEx(VBInstance.MainWindow.hWnd, 0, "MDIClient", vbNullString)
   If hWndMDIClient Then
      Call apiGetClientRect(hWndMDIClient, rc)
      For Each wnd In VBInstance.Windows
         If wnd Is VBInstance.ActiveWindow Then
            wnd.top = 0
            wnd.left = 0
            wnd.Width = rc.right
            wnd.Height = rc.bottom
            Exit Sub
         End If
      Next
   End If
End Sub

Thx for contribution
Please consider the question closed.
0
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.

All Courses

From novice to tech pro — start learning today.