Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a floating toolbar?

Status
Not open for further replies.

VB400

Programmer
Sep 8, 1999
359
US
<br>Does anyone know how to create a floating toolbar?&nbsp;&nbsp;I'm trying to mimic the function of the Toolbox that is in the VB IDE (using application-specific buttons)!<br><br>In the VB IDE, the Standard toolbar may be moved from its default location under the menu and it can become a floating toolbar (like a separate window).&nbsp;&nbsp;Is there anyway I can do this?<br><br>Thanks
 
well , you can create a form, and are able to remove it's caption bar, it make it only a caption bar with no buttons on it, and unsure if you can change this during runtime, but making the caption and border change, depending on where you put it, also far as the toolbar goes, making a normal toolbar in it, only make it the exact size of the form itself. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
I have seen the &quot;correct&quot; answer post in this forum but I forgot to bookmark it. I've used the SetWindowPos function in the past and it seems to work as well.<br>Place the toolbar on a small, borderless, captionless form. The SetWindowPos function in the form resize event will give it an &quot;always-on-top&quot; property.<br><br>Global Const SWP_NOMOVE = 2<br>Global Const SWP_NOSIZE = 1<br>Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE<br>Global Const HWND_TOPMOST = -1<br>Global Const HWND_NOTOPMOST = -2<br><br>Declare Function SetWindowPos Lib &quot;user32&quot; (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long<br><br>Private Sub Form_Resize()<br>RetVal% = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)<br>End Sub<br><br>Hope this works for you until somebody can post the programmatically correct answer.<br> <p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>
 
<br>Thanks for the info.&nbsp;&nbsp;I like the stay-on-top code and I'll make use of it.<br><br>I guess then that there is no VB-built-in feature that provides floating toolbars and that we just have to get creative in coming out with our own!<br><br>Any more ideas are still welcomed<br><br>Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top