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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

office toolbars 1

Status
Not open for further replies.

paveway

Programmer
Jan 6, 1999
17
AU
Sorry if this question has been asked before (and if it has then can you point me in the direction in which it was answered) but how do you get internet explorer or microsoft office style toolbars using any of the controls which come with vb 6?<br>
Thanks in advance
 
There is something called Command Bar<br>
don't know which .ocx it is or much other than that.<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
<i>the Following Code was Obtained from <br>
<A HREF=" TARGET="_new"><br>
Good Luck!<br>
<br>
Create a new project, and add the Common Controls ActiveX control to it. <br>
<br>
Draw the Toolbar onto a form. Add your buttons. <br>
<br>
Place the following code into a new module: <br>
<br>
Declare Function GetWindowLong Lib &quot;user32&quot; _<br>
Alias &quot;GetWindowLongA&quot; (ByVal hwnd As Long, _<br>
ByVal nIndex As Long) As Long<br>
Declare Function SetWindowLong Lib &quot;user32&quot; _<br>
Alias &quot;SetWindowLongA&quot; (ByVal hwnd As Long, _<br>
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long<br>
Declare Function FindWindowEx Lib &quot;user32&quot; _<br>
Alias &quot;FindWindowExA&quot; (ByVal hWndParent As _<br>
Long, ByVal hWndChildWindow As Long, ByVal _<br>
lpClassName As String, ByVal lpsWindowName _<br>
As String) As Long<br>
<br>
Public Const GWL_STYLE = &HFFF0<br>
<br>
Public Const TBSTYLE_FLAT = &H800<br>
<br>
Public Sub TBar97(TBar As Toolbar)<br>
<br>
Dim lTBarStyle As Long, lTBarHwnd As Long<br>
<br>
If Not TypeOf TBar Is Toolbar Then Exit Sub<br>
<br>
lTBarHwnd = FindWindowEx(TBar.hwnd, 0&, &quot;ToolbarWindow32&quot;, vbNullString)<br>
lTBarStyle = GetWindowLong(lTBarHwnd, GWL_STYLE)<br>
lTBarStyle = lTBarStyle Or TBSTYLE_FLAT<br>
lTBarStyle = SetWindowLong(lTBarHwnd, GWL_STYLE, lTBarStyle)<br>
TBar.Refresh<br>
End Sub<br>
Now, in the Form's load event, call TBar97 to make your ToolBar into a CoolBar!<br>
<br>
TBar97 ToolBar1<br>
<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, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
OH! and another thing, that code only works with VB4/5, if you want the same effect with VB 6 use the toolbar's style property, and set it to tbrFlat.<br>
<br>
<br>
<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, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
I have tried it and it is the flat toolbar, but how do i make it so no text is there?&nbsp;&nbsp;When i try to have no text, the toolbat still allocates a small space for the text anyway.&nbsp;&nbsp;And also the toolbar is still not the one that Microsoft uses in its office suite and ie etc.&nbsp;&nbsp;(i.e. you don't have the little lines on the left to slide the toolbat left and right)
 
might try messing around with some of the other properties as well, might hit something, other than that, I am uncertain. <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, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top