Solved

VB simple addin

Posted on 2006-11-10
8
199 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now