Jump to content

When i add a picture to background i can't use any button


Go to solution Solved by Melba23,

Recommended Posts

here when i add a picture to background i can see the button but i can't use it ...

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 610, 434, 192, 124)
$Pic1 = GUICtrlCreatePic("C:\Users\The-Wise\Desktop\صلاتى\simple.jpg", 0, 0, 609, 433)
$Button1 = GUICtrlCreateButton("Button1", 48, 112, 193, 113)
$Button2 = GUICtrlCreateButton("Button2", 240, 224, 193, 113)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            MsgBox(0,"","1")
        Case $Button2
            MsgBox(0,"","2")

    EndSwitch
WEnd
Link to post
Share on other sites
  • Moderators

yousefsamy,

I told you the other day to read the Help file. Look at the "Remarks" section for GUICtrlCreatePic - the 7th paragraph is the one you need. :)

Post again if you still need help after reading that paragraph - but post the contents as well so I can be sure you have actually read it. ;)

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 post
Share on other sites

i found it here :

$Pic1 = GUICtrlCreatePic("C:\Users\The-Wise\Desktop\صلاتى\simple.jpg", 0, 0, 609, 433,$SS_BITMAP)

is it right like this ....

=---------------------

i have another question can i make a clock in input !! here is my code

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>


Local Const $time = @HOUR&":"&@MIN&":"&@SEC

$Form1 = GUICreate("Ramadan", 200, 200, -1, -1)
$Input1 = GUICtrlCreateInput($time, 64, 32, 121, 28)
GUICtrlSetFont(-1, 12, 400, 0, "Neo Tech Alt Medium")
GUISetState(@SW_SHOW)


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


    EndSwitch
WEnd
Link to post
Share on other sites

What do you mean make a clock in the input? Like show the date/time in the input box or use a timer to see how long something has been since input was issued?

Link to post
Share on other sites
  • Moderators

yousefsamy ,

That is certainly one way to solve the problem - by removing the $SS_NOTIFY style you do not have overlapping active controls and so AutoIt knows what to action. The more usual way - as explained in that para - is to disable the Pic control. But both have the same result. :)

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 post
Share on other sites
  • Moderators

yousefsamy,

Use GUICtrlSetData and the Time And Date macros such as @Year. :)

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 post
Share on other sites

i want to make it change it self every second 

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>

$time = @HOUR&":"&@MIN&":"&@SEC

$Form1 = GUICreate("Ramadan", 200, 200, -1, -1)
$Input1 = GUICtrlCreateInput("", 64, 32, 121, 28,$ES_READONLY)
GUICtrlSetData($Input1,$time)
GUICtrlSetFont(-1, 12, 400, 0, "Neo Tech Alt Medium")
GUISetState(@SW_SHOW)


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


    EndSwitch
WEnd
Link to post
Share on other sites
  • Moderators

yousefsamy,

And which of those macros do you suppose changes every second? ;)

Just look for the change in the idle loop and rewrite the content when necessary. :)

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 post
Share on other sites
  • Moderators
  • Solution

yousefsamy,

What I suggested was this:

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$iCurrentSec = -1

$Form1 = GUICreate("Ramadan", 200, 200, -1, -1)
$Input1 = GUICtrlCreateInput("", 64, 32, 121, 28,$ES_READONLY)
GUISetState(@SW_SHOW)


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    If @SEC <> $iCurrentSec Then ; Wait for the change of second
        $iCurrentSec = @SEC
        GUICtrlSetData($Input1, @HOUR & ":" & @MIN & ":" & @Sec)
    EndIf

WEnd
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 post
Share on other sites
  • Moderators

yousefsamy,

As I tell you so often, the Help file is your friend - look at the Operators page to understand <> and all other signs in AutoIt. ;)

We set $iCurrentSec to -1 at the start so that the first time we check the current value in @Sec it will always be different and so the update is triggered. Clear now? :)

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 post
Share on other sites

it's clear because sec will never be -1 ^_^ you are the best bro

but if i change it with 1 it will be work i tried that ??

please can you try this code and tell me your opinion 

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <sendmessage.au3>

Local Const $move= 0xF012



$Form1 = GUICreate("Ramadan", 200, 200, -1, -1,$WS_SIZEBOX,$WS_EX_WINDOWEDGE)
$Input1 = GUICtrlCreateInput("", 64, 32, 121, 28,$ES_READONLY,$WS_TABSTOP)
GUICtrlSetFont(-1, 12, 400, 0, "Neo Tech Alt Medium")
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            _SendMessage($Form1,$WM_SYSCOMMAND,$move)


    EndSwitch

        GUICtrlSetData($Input1, @HOUR & ":" & @MIN & ":" & @Sec)

WEnd
Edited by yousefsamy
Link to post
Share on other sites
  • Moderators

yousefsamy,

 

but if i change it with 1 it will be work

Have you tried to see? ;)

Just to be clear, it will work with any initial value - all you risk is having to wait for 1 second for the clock to start if you happen to choose the value of the current second as you start the script. :)

M23

P.S. And please stop calling me "bro". ;)

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 post
Share on other sites

okay but can i make an alarm with this code ??

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <sendmessage.au3>

Local Const $move= 0xF012



$Form1 = GUICreate("Ramadan", 200, 200, -1, -1,$WS_SIZEBOX,$WS_EX_WINDOWEDGE)
$Input1 = GUICtrlCreateInput("", 64, 32, 121, 28,$ES_READONLY,$WS_TABSTOP)
GUICtrlSetFont(-1, 12, 400, 0, "Neo Tech Alt Medium")
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            _SendMessage($Form1,$WM_SYSCOMMAND,$move)


    EndSwitch

        $alarm = GUICtrlSetData($Input1, @HOUR & ":" & @MIN & ":" & @Sec)

        If $alarm = "22:53:30" Then
            MsgBox(0,"","")
            EndIf

WEnd
Link to post
Share on other sites
  • Moderators

yousefsamy,

What do you think is in the $alarm variable? :huh:

It is certainly not what you think. What does the Help file say is returned by the GUICtrlSetData function? Not the value you have just set, that is for sure! ;)

Answer me that and we will discuss how you might get your alarm to work. :)

M23

P.S. And what happened to the once-per-second update code? You are very likely to get flickering of the input content if you update it on every pass through the idle loop. ;)

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 post
Share on other sites

and what about this !! 

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <sendmessage.au3>

Local Const $move= 0xF012



$Form1 = GUICreate("Ramadan", 200, 200, -1, -1,$WS_SIZEBOX,$WS_EX_WINDOWEDGE)
$Input1 = GUICtrlCreateInput("", 64, 32, 121, 28,$ES_READONLY,$WS_TABSTOP)
GUICtrlSetFont(-1, 12, 400, 0, "Neo Tech Alt Medium")
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            _SendMessage($Form1,$WM_SYSCOMMAND,$move)


    EndSwitch

        $alarm = GUICtrlSetData($Input1, @HOUR & ":" & @MIN & ":" & @Sec)
        $time = GUICtrlRead($Input1)

        If $time = "23:09:00" Then
            MsgBox(0,"","")
            EndIf

WEnd
Link to post
Share on other sites
  • Moderators

yousefsamy,

That should work - although I would do it this way:

$sTime = @HOUR & ":" & @MIN & ":" & @Sec
GUICtrlSetData($Input1, $sTime)
If $sTime = "22:54:00" Then
    MsgBox(0,"","")
EndIf
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 post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...