Jump to content

Tab with icons


HAL9000
 Share

Recommended Posts

You would need to have an owner drawn tab. You can put a label on a tab and there is an example by Valik somewhere to show how to make coloured tabs, but a pic or an icon will get the tab drawn over it.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hi.

If you want to get result like this ? => Posted Image

Here is :

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\user\Рабочий стол\Form1.kxf
$Form1 = GUICreate("", 215, 175, 465, 282)
$Tab1 = GUICtrlCreateTab(0, 0, 180, 23,$BS_ICON)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
GUICtrlSetImage(-1,@ScriptDir&"\one.ico")


$TabSheet2=GUICtrlCreateTabItem("TabSheet2")
GUICtrlSetImage(-1,@ScriptDir&"\two.ico")
GUICtrlCreateTabItem("")


$Button1 = GUICtrlCreateButton("Button1", 64, 112, 73, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Tab1
            Switch GUICtrlRead($Tab1)
                Case 0
                    MsgBox(64,"TabItem1","Tabitem1",10)
                Case 1
                    MsgBox(64,"Tabitem2","Tabitem2",10)



                    EndSwitch

    EndSwitch
WEnd

ANd of course you need icons:

Here is for test:

http://qovluq.biz/uploads/tabwithicons.rar (script.au3+one.ico+two.ico)

MD5 SUM 84a1857a5cac97be59479eb5d6cd9840 *tabwithicons.rar

[size="5"] [/size]
Link to comment
Share on other sites

Something like this?

#include "OwnTab.au3"

Local $hGui = GUICreate("OwnTab-UDF Example with big icons", 320, 280)
GUISetBkColor(0xbbbbbb)


#Region OwnTab3
Local $aTabText[2] = ["Tab1", "Tab2"] ;Declare the regions for the OwnTab-control
Local $aTabIcons[2][2] = [["shell32.dll", -11],["shell32.dll", -61]]
Global $aCtrlTab3 = _OwnTab_Create($hGui, $aTabText, 10, 10, 300, 190, 70, 0xD5D5D5, 0x00ff00, 0x00ff00, $aTabIcons)
_OwnTab_Add($aCtrlTab3) ;Start controls tab1
GUICtrlCreateLabel("Just testing...", 30, 180, 100, 20)
GUICtrlSetBkColor(-1, -2)
_OwnTab_Add($aCtrlTab3) ;Start controls tab2
GUICtrlCreateLabel("Hello from tab2", 30, 180, 100, 20)
GUICtrlSetBkColor(-1, -2)
_OwnTab_End($aCtrlTab3)
#EndRegion

GUISetState()

Local $msg

While 1
 $msg = GUIGetMsg()
 For $a = 1 To UBound($aCtrlTab3, 1) - 1
  If $msg = $aCtrlTab3[$a][0] Then
   _OwnTab_Switch($aCtrlTab3, $a)
  EndIf
 Next
 Switch $msg
  Case -3
   Exit
 EndSwitch
 Sleep(10)
WEnd

OwnTab.au3

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...