?
Solved

VB simple addin

Posted on 2006-11-10
8
Medium Priority
?
215 Views
Last Modified: 2010-04-30
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
0
Comment
Question by:EugeneSLO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 15

Expert Comment

by:JackOfPH
ID: 17919946
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
 

Author Comment

by:EugeneSLO
ID: 17919959
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
 
LVL 22

Expert Comment

by:danaseaman
ID: 17922546
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
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!

 

Author Comment

by:EugeneSLO
ID: 17922567
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
 

Author Comment

by:EugeneSLO
ID: 17935963
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
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 18449425
PAQed with points refunded (500)

DarthMod
Community Support Moderator
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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

719 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