Guidance
指路人
g.yi.org
software / rapidq / Examples / GUI / Button / ButtonBar / ButtonBar.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'Button Bar version 1.0 by Danny Jackson
'This code was created a a freeware demonstration of using
'API calls to run different types of programs

     $INCLUDE "RAPIDQ.INC"
     DECLARE FUNCTION WinExec LIB "kernel32" ALIAS "WinExec" _
      (BYVAL lpCmdLine AS STRING, BYVAL nCmdShow AS LONG) AS LONG
     DECLARE FUNCTION ShellExecute LIB "shell32.dll" ALIAS "ShellExecuteA" (BYVAL hwnd AS LONG, BYVAL lpOperation AS STRING, BYVAL lpFile AS STRING, _
      BYVAL lpParameters AS STRING, BYVAL lpDirectory AS STRING, BYVAL nShowCmd AS LONG) AS LONG
     DECLARE SUB Button1Click (Sender AS QBUTTON)
     DECLARE SUB Button2Click (Sender AS QBUTTON)
     DECLARE SUB Button3Click (Sender AS QBUTTON)
     DECLARE SUB Button4Click (Sender AS QBUTTON)
     DECLARE SUB Button5Click (Sender AS QBUTTON)
     DECLARE SUB Button6Click (Sender AS QBUTTON)
     DECLARE SUB Button7Click (Sender AS QBUTTON)
     DECLARE SUB Button8Click (Sender AS QBUTTON)
     DECLARE SUB Button10Click (Sender AS QBUTTON)

     $OPTION ICON "ButtonBar.ico"

     CREATE Form AS QFORM
      CAPTION = "Button Bar"
      Cursor = crHandPoint
      Width =     275
      Height = 75
      Center
      CREATE Button1 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\Control Panel.bmp"
       Left = 0
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "Run Control Panel"
       Default = 1
       OnClick = Button1Click
      END CREATE
      CREATE Button2 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\Exit.bmp"
       Left = 227
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "Exit the program"
       TabOrder = 1
       OnClick = Button2Click
      END CREATE
      CREATE Button3 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\WExplorer.bmp"
       Left = 29
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "Run Windows Explorer"
       TabOrder = 2
       OnClick = Button3Click
      END CREATE
      CREATE Button4 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\Calc.bmp"
       Left = 58
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "Run Windows Calculator"
       TabOrder = 3
       OnClick = Button4Click
      END CREATE
      CREATE Button5 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\CharMap.bmp"
       Left = 87
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "Run Character Map"
       TabOrder = 4
       OnClick = Button5Click
      END CREATE
      CREATE Button6 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\IExplorer.bmp"
       Left = 115
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "Run Internet Explorer"
       TabOrder = 5
       OnClick = Button6Click
      END CREATE
      CREATE Button7 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\about.bmp"
       Left = 199
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "About Button Bar"
       TabOrder = 6
       OnClick = Button7Click
      END CREATE
      CREATE Button8 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\Dos.bmp"
       Left = 143
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "Ms Dor Promt"
       TabOrder = 7
       OnClick = Button8Click
      END CREATE
      CREATE Button9 AS QBUTTON
       CAPTION = "Button9"
       Left = -369
       Top = -268
       TabOrder = 8
      END CREATE
      CREATE Button10 AS QBUTTON
       CAPTION = ""
       BMP = "C:\RapidQ\Help.bmp"
       Left = 171
       Top = 5
       Width = 25
       ShowHint = 1
       Hint = "Invoke the Help File"
       TabOrder = 9
       OnClick = Button10Click
      END CREATE
     END CREATE

'Insert your initialization code here

     Form.SHOWMODAL

'--------- Subroutines ---------

     SUB Button1Click (Sender AS QBUTTON)
  'run control panel
      WinExec "Control.exe" ,10
     END SUB

     SUB Button2Click (Sender AS QBUTTON)
  'exit
      Form.CLOSE
     END SUB

     SUB Button3Click (Sender AS QBUTTON)
  'run windows explorer
      WinExec "Explorer.exe", 10
     END SUB

     SUB Button4Click (Sender AS QBUTTON)
  'run calculator
      WinExec "Calc.exe", 10
     END SUB

     SUB Button5Click (Sender AS QBUTTON)
  'run character map
      WinExec "CharMap.exe", 10
     END SUB

     SUB Button6Click (Sender AS QBUTTON)
  'run internet explorer
      WinExec "c:\Program Files\Internet Explorer\IExplore.exe", 10
     END SUB

     SUB Button7Click (Sender AS QBUTTON)
  'about button bar
      PLAYWAV "Trying to Think.wav",1
      MESSAGEDLG ("Button Bar v 1.0 , Danny Jackson", _
       mtInformation, mbOK, 0)
     END SUB

     SUB Button8Click (Sender AS QBUTTON)
  'invoke the dos prompt
      WinExec "DOSPRMPT.pif" ,10
     END SUB

     SUB Button10Click (Sender AS QBUTTON)
  'invoke the help file
      ShellExecute (0, "Open", "ButtonBar.chm", "", "", 1)
     END SUB

掌柜推荐
 
 
¥1,420.00 ·
 
 
¥950.00 ·
 
 
¥288.00 ·
 
 
¥738.00 ·
 
 
¥397.00 ·
 
 
¥750.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-12-31 02:28:06