Sign in to follow this  
Followers 0
Robin

Button on top of $Pic_1 = GUICtrlCreatePic("icon.gif", 10, 20, 102, 100)

7 posts in this topic

The button on top of ---> $Pic_1 = GUICtrlCreatePic("icon.gif", 10, 20, 102, 100) <---

does not function. Is there a way of telling the button to be on top, so it can function?

If i click on a button without a pic underneath, it works 100%...

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

show us what you have programed so far

Func booster()

Local $BUTTON_1, $BUTTON_2, $BUTTON_3, $MSG, $var1, $font, $var2, $var3, $var4, $FILENAME, $FIND, $REPLACE, $Retval3, $Lan_adsl

Local $I, $test1, $exists, $check1

$var1 = "Compiled by:"

$var2 = "Me"

$font = "Comic Sans MS"

GUICreate("XP-Booster - V1.00", 290, 150)

Opt("GUICoordMode", 1)

GUICtrlCreateLabel(" Compiled by: Me", 10, 10)

GUICtrlSetColor(-1, 0x3333cc)

;GUISetBkColor(0x000)

TraySetState(2)

;$Pic_1 = GUICtrlCreatePic("icon.gif", 10, 20, 102, 100)<---THIS IS THE PROB

$BUTTON_1 = GUICtrlCreateButton("Speedup PC?", 10, 40, 120)<--- tHIS BUTTON STANDS STILL

$BUTTON_2 = GUICtrlCreateButton("Speedup Internet?", 140, 40, 140)

$BUTTON_3 = GUICtrlCreateButton("Create/Restore Registry...", 80, 90, 140)

$FILENAME = "c:\boot.ini"

$FIND = "optin"

$REPLACE = "Alwaysoff"

$percentMax = 50

$pbLeft = 10

$pbTop = 130

$pbWidth = 270

$pbHeigth = 10

$pb = GUICtrlCreateProgress($pbLeft, $pbTop, $pbWidth, $pbHeigth, BitOR($WS_CLIPSIBLINGS, $PBS_SMOOTH))

GUISetState()

While 1

$MSG = GUIGetMsg()

Select

Case $MSG = $GUI_EVENT_CLOSE

ExitLoop

Case $MSG = $BUTTON_1

If FileExists($FILENAME) = 1 Then

$Retval3 = FileSetAttrib("C:\boot.ini", "-R+A-S-H")

_ReplaceStringInFile($FILENAME, $FIND, $REPLACE)

Else

MsgBox(0, "Booster V1.00", "No Boot.ini or not accessable...Sure this is WIN-XP?")

EndIf

If FileExists($FILENAME) = 1 Then

DirCreate("C:\bstr")

FileInstall("Speed-xp2-xp3.reg", "c:\bstr\Speed-xp2-xp3.reg", 1)

FileInstall("shellnoroam.reg", "c:\bstr\shellnoroam.reg", 1)

$var3 = FileInstall("shell.reg", "c:\bstr\shell.reg", 1)

If $var3 = 1 Then

For $I = 0 To 100 Step 5

$test1 = GUICtrlSetData($pb, $I)

RunWait("regedit /s c:\bstr\Speed-xp2-xp3.reg")

RunWait("regedit /s c:\bstr\shellnoroam.reg")

RunWait("regedit /s c:\bstr\shell.reg")

FileDelete("c:\bstr\*.*")

DirRemove("C:\bstr")

Next

MsgBox(0, "All Done!", "PLEASE RE-START COMPUTER!!", 10)

For $I = 100 To 0 Step -10

$test1 = GUICtrlSetData($pb, $I)

Next

EndIf

EndIf

If FileExists($FILENAME) = 0 Then

$check1 = MsgBox(0x4, "Question", "Do you still want to add the registry settings?")

If $check1 = 6 Then

DirCreate("C:\bstr")

FileInstall("Speed-xp2-xp3.reg", "c:\bstr\Speed-xp2-xp3.reg", 1)

FileInstall("shellnoroam.reg", "c:\bstr\shellnoroam.reg", 1)

$var3 = FileInstall("shell.reg", "c:\bstr\shell.reg", 1)

If $var3 = 1 Then

For $I = 0 To 100 Step 5

$test1 = GUICtrlSetData($pb, $I)

;GUICtrlSetColor(-1, 32250)

RunWait("regedit /s c:\bstr\Speed-xp2-xp3.reg")

RunWait("regedit /s c:\bstr\shellnoroam.reg")

RunWait("regedit /s c:\bstr\shell.reg")

FileDelete("c:\bstr\*.*")

DirRemove("C:\bstr")

Next

MsgBox(0, "All Done!", "PLEASE RE-START COMPUTER!!", 10)

For $I = 100 To 0 Step -10

$test1 = GUICtrlSetData($pb, $I)

Sleep(100)

Next

EndIf

Else

MsgBox(0, "Abort", "Aborting...", 1)

EndIf

EndIf

its not the whole code, but will give u an idea.

Basicly, any button thats on top of a bitmap/graphic doesnt buldge at all

Edited by Robin

Share this post


Link to post
Share on other sites

Func booster()

Local $BUTTON_1, $BUTTON_2, $BUTTON_3, $MSG, $var1, $font, $var2, $var3, $var4, $FILENAME, $FIND, $REPLACE, $Retval3, $Lan_adsl

Local $I, $test1, $exists, $check1

$var1 = "Compiled by:"

$var2 = "Me"

$font = "Comic Sans MS"

GUICreate("XP-Booster - V1.00", 290, 150)

Opt("GUICoordMode", 1)

GUICtrlCreateLabel(" Compiled by: Me", 10, 10)

GUICtrlSetColor(-1, 0x3333cc)

;GUISetBkColor(0x000)

TraySetState(2)

;$Pic_1 = GUICtrlCreatePic("icon.gif", 10, 20, 102, 100)<---THIS IS THE PROB

$BUTTON_1 = GUICtrlCreateButton("Speedup PC?", 10, 40, 120)<--- tHIS BUTTON STANDS STILL

$BUTTON_2 = GUICtrlCreateButton("Speedup Internet?", 140, 40, 140)

$BUTTON_3 = GUICtrlCreateButton("Create/Restore Registry...", 80, 90, 140)

$FILENAME = "c:\boot.ini"

$FIND = "optin"

$REPLACE = "Alwaysoff"

$percentMax = 50

$pbLeft = 10

$pbTop = 130

$pbWidth = 270

$pbHeigth = 10

$pb = GUICtrlCreateProgress($pbLeft, $pbTop, $pbWidth, $pbHeigth, BitOR($WS_CLIPSIBLINGS, $PBS_SMOOTH))

GUISetState()

While 1

$MSG = GUIGetMsg()

Select

Case $MSG = $GUI_EVENT_CLOSE

ExitLoop

Case $MSG = $BUTTON_1

If FileExists($FILENAME) = 1 Then

$Retval3 = FileSetAttrib("C:\boot.ini", "-R+A-S-H")

_ReplaceStringInFile($FILENAME, $FIND, $REPLACE)

Else

MsgBox(0, "Booster V1.00", "No Boot.ini or not accessable...Sure this is WIN-XP?")

EndIf

If FileExists($FILENAME) = 1 Then

DirCreate("C:\bstr")

FileInstall("Speed-xp2-xp3.reg", "c:\bstr\Speed-xp2-xp3.reg", 1)

FileInstall("shellnoroam.reg", "c:\bstr\shellnoroam.reg", 1)

$var3 = FileInstall("shell.reg", "c:\bstr\shell.reg", 1)

If $var3 = 1 Then

For $I = 0 To 100 Step 5

$test1 = GUICtrlSetData($pb, $I)

RunWait("regedit /s c:\bstr\Speed-xp2-xp3.reg")

RunWait("regedit /s c:\bstr\shellnoroam.reg")

RunWait("regedit /s c:\bstr\shell.reg")

FileDelete("c:\bstr\*.*")

DirRemove("C:\bstr")

Next

MsgBox(0, "All Done!", "PLEASE RE-START COMPUTER!!", 10)

For $I = 100 To 0 Step -10

$test1 = GUICtrlSetData($pb, $I)

Next

EndIf

EndIf

If FileExists($FILENAME) = 0 Then

$check1 = MsgBox(0x4, "Question", "Do you still want to add the registry settings?")

If $check1 = 6 Then

DirCreate("C:\bstr")

FileInstall("Speed-xp2-xp3.reg", "c:\bstr\Speed-xp2-xp3.reg", 1)

FileInstall("shellnoroam.reg", "c:\bstr\shellnoroam.reg", 1)

$var3 = FileInstall("shell.reg", "c:\bstr\shell.reg", 1)

If $var3 = 1 Then

For $I = 0 To 100 Step 5

$test1 = GUICtrlSetData($pb, $I)

;GUICtrlSetColor(-1, 32250)

RunWait("regedit /s c:\bstr\Speed-xp2-xp3.reg")

RunWait("regedit /s c:\bstr\shellnoroam.reg")

RunWait("regedit /s c:\bstr\shell.reg")

FileDelete("c:\bstr\*.*")

DirRemove("C:\bstr")

Next

MsgBox(0, "All Done!", "PLEASE RE-START COMPUTER!!", 10)

For $I = 100 To 0 Step -10

$test1 = GUICtrlSetData($pb, $I)

Sleep(100)

Next

EndIf

Else

MsgBox(0, "Abort", "Aborting...", 1)

EndIf

EndIf

its not the whole code, but will give u an idea.

Basicly, any button thats on top of a bitmap/graphic doesnt buldge at all

Anyone?

Please note, this aint the full script...im just trying to point out where i get the hassle :D

tia

Share this post


Link to post
Share on other sites

Robin,

1. Bumping yourself...and copying your own code again. :-( Please use the "Add Reply" button, not "Reply" (it is only 1cm below!)

2. Please use code tags. Put [code ] before and [/code ] after the code in your post (omit the trailing spaces - they are only there so the tags display).

3. And finally, from that ever useful help file:

"If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls: GuiCtrlSetState(-1,$GUI_DISABLE). "

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

TraySetState(2)
    $Pic_1 = GUICtrlCreatePic("icon.gif", 10, 12, 640, 512) ;<---THIS IS THE PROB

    $BUTTON_1 = GUICtrlCreateButton("Speedup PC?", 10, 40, 120) ;< - - - tHIS BUTTON STANDS STILL

remember you are suppose to put the x and y along with the dimension on the full picture.

Edited by TerarinK

0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

Thanks guys...

Share this post


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
Sign in to follow this  
Followers 0