Jump to content

Statusbar is not showing when form contains menu control


Go to solution Solved by Zedna,

Recommended Posts

hi I am trying to make a radio player. I done the design but for some odd reason my status bar is not showing. it will only show if I comment out the code that creates the menu. any idea why this is happening I left my GUI code below.

Thanks

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <GuiStatusBar.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$frmmain = GUICreate("DM MyRadio", 407, 411, -1, -1)
$MenuItem1 = GUICtrlCreateMenu("MenuItem")
$cmdplay = GUICtrlCreateButton("Play", 18, 258, 59, 49)
GUICtrlSetColor(-1, 0x000000)
$lblStations = GUICtrlCreateLabel("Current Stations", 12, 14, 95, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$lstStations = GUICtrlCreateList("", 8, 31, 361, 177, BitOR($GUI_SS_DEFAULT_LIST,$LBS_NOINTEGRALHEIGHT))
$lblTitleVol = GUICtrlCreateLabel("Volume", 11, 221, 39, 17)
$lbl3dLine1 = GUICtrlCreateLabel("Label1", 0, 0, 406, 2, $SS_ETCHEDHORZ)
$cmdPause = GUICtrlCreateButton("P&ause", 82, 258, 59, 49)
GUICtrlSetColor(-1, 0x000000)
$cmdStop = GUICtrlCreateButton("&Stop", 146, 258, 59, 49)
$sVolume = GUICtrlCreateSlider(48, 215, 200, 27, BitOR($TBS_BOTH,$TBS_NOTICKS,$TBS_ENABLESELRANGE))
GUICtrlSetData(-1, 50)
$lblVolume = GUICtrlCreateLabel("50%", 248, 222, 24, 17, $SS_CENTER)
GUICtrlSetColor(-1, 0x000080)
$lbl3dLine2 = GUICtrlCreateLabel("Label1", 20, 247, 327, 2, $SS_ETCHEDHORZ)
$StatusBar1 = _GUICtrlStatusBar_Create($frmmain)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 17)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

On Error Resume Pulling Hair Out.

Link to comment
Share on other sites

  • Solution

It seems that this is bug only in some versions of AutoIt.
3.2.12.1 - OK
3.3.12.0 - BUG
3.3.13.14 - OK
 
There is simple workaround:

...

$frmmain = GUICreate("DM MyRadio", 407, 411, -1, -1)
$MenuItem1 = GUICtrlCreateMenu("MenuItem")
...
$StatusBar1 = _GUICtrlStatusBar_Create($frmmain)
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUISetState(@SW_SHOW)

...

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    _GuiCtrlStatusBar_Resize($StatusBar1)
    Return $GUI_RUNDEFMSG
EndFunc

or this one:

...

$frmmain = GUICreate("DM MyRadio", 407, 411, -1, -1)
$MenuItem1 = GUICtrlCreateMenu("MenuItem")
...
$StatusBar1 = _GUICtrlStatusBar_Create($frmmain)
GUISetState(@SW_SHOW)
_GuiCtrlStatusBar_Resize($StatusBar1)
Edited by Zedna
Link to comment
Share on other sites

  • Moderators

DreamVB,

Always worth a look in Trac to see if someone has already reported it. As you can see #2588 was fixed a while ago. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...