Solved

VB simple addin

Posted on 2006-11-10
8
198 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
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now