je vous remercie d'avoir posté



moi se qui me faudrait c'est le code tout simple pour avoir une page web quand on clique sur le bouton

voila sa serat tout pour moi

Code : Tout sélectionner
;- Window Constants
Enumeration
#Window_0
#Window_1
EndEnumeration
;- Gadget Constants
Enumeration
#Button_0
#Web_0
EndEnumeration
Procedure Open_Window_1()
If OpenWindow(#Window_1, 215, 334, 600, 300, "fenetre n°2", #PB_Window_SystemMenu | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_1))
WebGadget(#Web_0, 5, 5, 590, 290, "www.google.fr")
EndIf
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadget()
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
CloseWindow(#Window_1)
EndProcedure
If OpenWindow(#Window_0, 216, 0, 600, 300, "fenetre n°1", #PB_Window_SystemMenu | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
ButtonGadget(#Button_0, 170, 90, 240, 90, "ouvrir fenetre n°2")
EndIf
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadget()
Case #Button_0
Open_Window_1()
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
End
Code : Tout sélectionner
Open_Window_0()
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
If GadgetID = #Button_1
Gosub fenetre_3
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;
; 2em fenetre
fenetre_3:
OpenWindow(#Window_2, 294, 245, 600, 300, "super site", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_2))
WebGadget(#Web_1, 5, 5, 590, 290, "http://purebasic.fr/french/viewforum.php?f=1")
Repeat
Event2 = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID2 = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID2 = EventGadget() ; Is it a gadget event?
EventType2 = EventType() ; The event type
Until Event2=#PB_Event_CloseWindow
CloseWindow(#Window_2)
Return
Open_Window_0()
EndIf
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
If GadgetID = #Button_3
Gosub fenetre_2
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;
; 2em fenetre
fenetre_2:
OpenWindow(#Window_1, 294, 245, 600, 300, "2eme fenetre", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_1))
WebGadget(#Web_0, 5, 5, 590, 290, "www.jeuxvideo.com")
Repeat
Event2 = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID2 = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID2 = EventGadget() ; Is it a gadget event?
EventType2 = EventType() ; The event type
Until Event2=#PB_Event_CloseWindow
CloseWindow(#Window_1)
Return
EndIf
Code : Tout sélectionner
Enumeration
#Window_0
#Window_1
#Window_2
EndEnumeration
Enumeration
#Button_0
#Button_1
#Button_2
#Button_3
EndEnumeration
Procedure Open_Window_1()
If OpenWindow(#Window_1, 216, 334, 300, 300, "1", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_1))
EndIf
EndIf
EndProcedure
Procedure Open_Window_2()
If OpenWindow(#Window_2, 526, 334, 300, 300, "2", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_2))
EndIf
EndIf
EndProcedure
If OpenWindow(#Window_0, 216, 0, 610, 300, "0", #PB_Window_SystemMenu | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
ButtonGadget(#Button_0, 10, 10, 200, 20, "ouvrir fenetre 1")
ButtonGadget(#Button_1, 400, 10, 200, 20, "ouvrir fenetre 2")
EndIf
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadget()
Case #Button_0
Open_Window_1()
Case #Button_1
Open_Window_2()
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
Code : Tout sélectionner
;
; ABCDEFGHIJKLMOPQRSTUVWXYZ
;
;
;
;
Enumeration
#Window_0
#Window_1
#Window_2
EndEnumeration
Enumeration
#Web_1
#Web_0
#Panel_1
#Button_1
#Button_3
EndEnumeration
Global FontID1
FontID1 = LoadFont(1, "Arial", 8, #PB_Font_Bold)
Global FontID2
FontID2 = LoadFont(2, "Arial", 8)
Global FontID3
FontID3 = LoadFont(3, "Arial", 8, #PB_Font_Bold | #PB_Font_Italic)
Procedure Open_Window_0()
If OpenWindow(#Window_0, 194, 310, 305, 329, "NoelOo tool v1.01", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
;- prog
PanelGadget(#Panel_1, 0, 0, 320, 330)
AddGadgetItem(#Panel_1, -1, "rien")
AddGadgetItem(#Panel_1, -1, "1ere fenetre")
ButtonGadget(#Button_1, 78, 278, 120, 20, "Telecharger le .bat")
AddGadgetItem(#Panel_1, -1, "2eme fenetre")
ButtonGadget(#Button_3, 58, 118, 170, 20, "2eme fenetre")
CloseGadgetList()
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
If GadgetID = #Button_1
Gosub fenetre_3
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;
; 2em fenetre
fenetre_3:
OpenWindow(#Window_2, 294, 245, 600, 300, "super site", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_2))
WebGadget(#Web_1, 5, 5, 590, 290, "http://purebasic.fr/french/viewforum.php?f=1")
Repeat
Event2 = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID2 = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID2 = EventGadget() ; Is it a gadget event?
EventType2 = EventType() ; The event type
Until Event2=#PB_Event_CloseWindow
CloseWindow(#Window_2)
Return
Open_Window_0()
EndIf
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
If GadgetID = #Button_3
Gosub fenetre_2
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;
; 2em fenetre
fenetre_2:
OpenWindow(#Window_1, 294, 245, 600, 300, "2eme fenetre", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_1))
WebGadget(#Web_0, 5, 5, 590, 290, "www.jeuxvideo.com")
Repeat
Event2 = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID2 = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID2 = EventGadget() ; Is it a gadget event?
EventType2 = EventType() ; The event type
Until Event =#PB_Event_CloseWindow
CloseWindow(#Window_1)
Return
EndIf
Code : Tout sélectionner
Enumeration
#Window_0
#Window_1
#Window_2
EndEnumeration
Enumeration
#Button_0
#Button_1
#Button_2
#Button_3
#Button_4
EndEnumeration
Procedure Open_Window_1()
If OpenWindow(#Window_1, 216, 334, 300, 300, "1", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_1))
ButtonGadget(#Button_3, 10, 10, 200, 20, "fenetre 1")
EndIf
EndIf
EndProcedure
Procedure Open_Window_2()
If OpenWindow(#Window_2, 526, 334, 300, 300, "2", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_2))
ButtonGadget(#Button_4, 10, 10, 200, 20, "fenetre 2")
EndIf
EndIf
EndProcedure
If OpenWindow(#Window_0, 216, 0, 610, 300, "0", #PB_Window_SystemMenu | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
ButtonGadget(#Button_0, 10, 10, 200, 20, "ouvrir fenetre 1")
ButtonGadget(#Button_1, 400, 10, 200, 20, "ouvrir fenetre 2")
EndIf
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadget()
Case #Button_0
Open_Window_1()
Case #Button_1
Open_Window_2()
Case #Button_3
MessageRequester("info", "vous avez appuier sur le boutton dans la fenetre n°1", 0)
Case #Button_4
MessageRequester("info", "vous avez appuier sur le boutton dans la fenetre n°2", 0)
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow