Hello guys
I'd like to add a button like "Visit my homepage" into a PB application and when someone clicks this button, it should open the default browser, and go to my web page.
I did not find this kind of example here, neither in the PB help
Could someone help me a bit.
Thanks/
Ekix
Hyperlink into a button
like this?
Code: Select all
Global Window_0, Button_0
Procedure Open_Window_0()
Window_0 = OpenWindow(#PB_Any, 0, 0, 200, 70, "ButtonUrl Demo", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
If Window_0
If CreateGadgetList(WindowID(Window_0))
Button_0 = ButtonGadget(#PB_Any, 10, 10, 180, 50, "visit my homepage")
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget
Select EventGadget()
Case Button_0
RunProgram("http://www.google.com")
EndSelect
EndIf
Until Event = #PB_Event_CloseWindow
End
Re: Hyperlink into a button
Why is your sig promoting the sale of cannabis?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Thanks
It works now as below
Ps. I did change my signature, look's like it's not popular here :=)
Code: Select all
If GadgetID = #Button_Home
RunProgram("http://www.ekisoft.com")
EndIf
Ekix
Ekix's Homepage
Ekix's Homepage