Solved

VB simple addin

Posted on 2006-11-10
8
203 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

821 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