home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / vbasic / Data / Utils / cmdbtnx5.msi / Cabs.w1.cab / Pictures.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-08-01  |  14.7 KB  |  442 lines

  1. VERSION 5.00
  2. Object = "{20976770-692B-4564-84B5-CCC822AA2B7A}#1.2#0"; "CmdBtnX5.ocx"
  3. Begin VB.Form frmPictures 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Pictures Demonstration"
  6.    ClientHeight    =   6495
  7.    ClientLeft      =   1950
  8.    ClientTop       =   1545
  9.    ClientWidth     =   6105
  10.    BeginProperty Font 
  11.       Name            =   "Tahoma"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "Pictures.frx":0000
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   433
  24.    ScaleMode       =   3  'Pixel
  25.    ScaleWidth      =   407
  26.    ShowInTaskbar   =   0   'False
  27.    StartUpPosition =   2  'CenterScreen
  28.    Begin CommandButtonXCtl.CommandButtonX cmdClose 
  29.       Cancel          =   -1  'True
  30.       Default         =   -1  'True
  31.       Height          =   375
  32.       Left            =   4815
  33.       TabIndex        =   22
  34.       Tag             =   "Close this demonstration window"
  35.       Top             =   5985
  36.       Width           =   1140
  37.       _ExtentX        =   2011
  38.       _ExtentY        =   661
  39.       DropDownPicture =   "Pictures.frx":014A
  40.       CaptionOffsetX  =   8
  41.       PictureAlignment=   3
  42.       Caption         =   "C&lose"
  43.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  44.          Name            =   "Tahoma"
  45.          Size            =   8.25
  46.          Charset         =   0
  47.          Weight          =   400
  48.          Underline       =   0   'False
  49.          Italic          =   0   'False
  50.          Strikethrough   =   0   'False
  51.       EndProperty
  52.       Picture         =   "Pictures.frx":01CC
  53.    End
  54.    Begin VB.CheckBox chkEnabled 
  55.       Caption         =   "Enabled"
  56.       Height          =   285
  57.       Left            =   3105
  58.       TabIndex        =   21
  59.       Tag             =   "Enables or disables the demonstration control"
  60.       Top             =   6030
  61.       Value           =   1  'Checked
  62.       Width           =   1140
  63.    End
  64.    Begin CommandButtonXDemo.pucTextTip tipPicture 
  65.       Height          =   1185
  66.       Left            =   135
  67.       Top             =   5130
  68.       Width           =   2805
  69.       _ExtentX        =   4948
  70.       _ExtentY        =   2090
  71.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  72.          Name            =   "Tahoma"
  73.          Size            =   8.25
  74.          Charset         =   0
  75.          Weight          =   400
  76.          Underline       =   0   'False
  77.          Italic          =   0   'False
  78.          Strikethrough   =   0   'False
  79.       EndProperty
  80.       Text            =   "pucSimpleTip2"
  81.    End
  82.    Begin CommandButtonXCtl.CommandButtonX cmdxDemo 
  83.       Height          =   1500
  84.       Left            =   3105
  85.       TabIndex        =   20
  86.       Top             =   4320
  87.       Width           =   2850
  88.       _ExtentX        =   5027
  89.       _ExtentY        =   2646
  90.       DropDownPicture =   "Pictures.frx":0326
  91.       HoverPicture    =   "Pictures.frx":03A8
  92.       Caption         =   ""
  93.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  94.          Name            =   "Tahoma"
  95.          Size            =   8.25
  96.          Charset         =   0
  97.          Weight          =   400
  98.          Underline       =   0   'False
  99.          Italic          =   0   'False
  100.          Strikethrough   =   0   'False
  101.       EndProperty
  102.       Picture         =   "Pictures.frx":0C82
  103.       DownPicture     =   "Pictures.frx":155C
  104.    End
  105.    Begin VB.Frame Frame1 
  106.       Caption         =   "Picture Properties:"
  107.       BeginProperty Font 
  108.          Name            =   "Tahoma"
  109.          Size            =   8.25
  110.          Charset         =   0
  111.          Weight          =   700
  112.          Underline       =   0   'False
  113.          Italic          =   0   'False
  114.          Strikethrough   =   0   'False
  115.       EndProperty
  116.       Height          =   3300
  117.       Left            =   135
  118.       TabIndex        =   0
  119.       Top             =   1665
  120.       Width           =   2850
  121.       Begin VB.CommandButton cmdAction 
  122.          Caption         =   "Clear"
  123.          Height          =   330
  124.          Index           =   7
  125.          Left            =   1440
  126.          TabIndex        =   12
  127.          Tag             =   "This picture is used when the mouse hovers over the button."
  128.          Top             =   2745
  129.          Width           =   1140
  130.       End
  131.       Begin VB.CommandButton cmdAction 
  132.          Caption         =   "Change..."
  133.          Height          =   330
  134.          Index           =   6
  135.          Left            =   270
  136.          TabIndex        =   11
  137.          Tag             =   "This picture is used when the mouse hovers over the button."
  138.          Top             =   2745
  139.          Width           =   1140
  140.       End
  141.       Begin VB.CommandButton cmdAction 
  142.          Caption         =   "Clear"
  143.          Height          =   330
  144.          Index           =   5
  145.          Left            =   1440
  146.          TabIndex        =   9
  147.          Tag             =   "This picture is used when either the button is checked, or if the mouse or keyboard is being used to press the button."
  148.          Top             =   2025
  149.          Width           =   1140
  150.       End
  151.       Begin VB.CommandButton cmdAction 
  152.          Caption         =   "Change..."
  153.          Height          =   330
  154.          Index           =   4
  155.          Left            =   270
  156.          TabIndex        =   8
  157.          Tag             =   "This picture is used when either the button is checked, or if the mouse or keyboard is being used to press the button."
  158.          Top             =   2025
  159.          Width           =   1140
  160.       End
  161.       Begin VB.CommandButton cmdAction 
  162.          Caption         =   "Clear"
  163.          Height          =   330
  164.          Index           =   3
  165.          Left            =   1440
  166.          TabIndex        =   6
  167.          Tag             =   $"Pictures.frx":1E36
  168.          Top             =   1305
  169.          Width           =   1140
  170.       End
  171.       Begin VB.CommandButton cmdAction 
  172.          Caption         =   "Change..."
  173.          Height          =   330
  174.          Index           =   2
  175.          Left            =   270
  176.          TabIndex        =   5
  177.          Tag             =   $"Pictures.frx":1ED7
  178.          Top             =   1305
  179.          Width           =   1140
  180.       End
  181.       Begin VB.CommandButton cmdAction 
  182.          Caption         =   "Clear"
  183.          Height          =   330
  184.          Index           =   1
  185.          Left            =   1440
  186.          TabIndex        =   3
  187.          Tag             =   $"Pictures.frx":1F78
  188.          Top             =   585
  189.          Width           =   1140
  190.       End
  191.       Begin VB.CommandButton cmdAction 
  192.          Caption         =   "Change..."
  193.          Height          =   330
  194.          Index           =   0
  195.          Left            =   270
  196.          TabIndex        =   2
  197.          Tag             =   $"Pictures.frx":2003
  198.          Top             =   585
  199.          Width           =   1140
  200.       End
  201.       Begin VB.Label lblHdr 
  202.          AutoSize        =   -1  'True
  203.          Caption         =   "HoverPicture:"
  204.          Height          =   195
  205.          Index           =   3
  206.          Left            =   270
  207.          TabIndex        =   10
  208.          Top             =   2520
  209.          Width           =   990
  210.       End
  211.       Begin VB.Label lblHdr 
  212.          AutoSize        =   -1  'True
  213.          Caption         =   "DownPicture:"
  214.          Height          =   195
  215.          Index           =   2
  216.          Left            =   270
  217.          TabIndex        =   7
  218.          Top             =   1800
  219.          Width           =   960
  220.       End
  221.       Begin VB.Label lblHdr 
  222.          AutoSize        =   -1  'True
  223.          Caption         =   "DisabledPicture:"
  224.          Height          =   195
  225.          Index           =   1
  226.          Left            =   270
  227.          TabIndex        =   4
  228.          Top             =   1080
  229.          Width           =   1155
  230.       End
  231.       Begin VB.Label lblHdr 
  232.          AutoSize        =   -1  'True
  233.          Caption         =   "Picture:"
  234.          Height          =   195
  235.          Index           =   0
  236.          Left            =   270
  237.          TabIndex        =   1
  238.          Top             =   360
  239.          Width           =   555
  240.       End
  241.    End
  242.    Begin CommandButtonXDemo.pucTextTip pucSimpleTip1 
  243.       Height          =   600
  244.       Left            =   135
  245.       Top             =   945
  246.       Width           =   5820
  247.       _ExtentX        =   10266
  248.       _ExtentY        =   1058
  249.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  250.          Name            =   "Tahoma"
  251.          Size            =   8.25
  252.          Charset         =   0
  253.          Weight          =   400
  254.          Underline       =   0   'False
  255.          Italic          =   0   'False
  256.          Strikethrough   =   0   'False
  257.       EndProperty
  258.       Text            =   "The CommandButtonX control has nine properties for dealing with pictures, from hover effects to image transparency."
  259.    End
  260.    Begin VB.Frame Frame2 
  261.       Caption         =   "Positioning:"
  262.       BeginProperty Font 
  263.          Name            =   "Tahoma"
  264.          Size            =   8.25
  265.          Charset         =   0
  266.          Weight          =   700
  267.          Underline       =   0   'False
  268.          Italic          =   0   'False
  269.          Strikethrough   =   0   'False
  270.       EndProperty
  271.       Height          =   2445
  272.       Left            =   3105
  273.       TabIndex        =   13
  274.       Top             =   1710
  275.       Width           =   2850
  276.       Begin VB.HScrollBar hsbX 
  277.          Height          =   240
  278.          Left            =   270
  279.          Max             =   50
  280.          Min             =   -50
  281.          TabIndex        =   17
  282.          Tag             =   "Adjusts the left-right offset, allowing extra positioning control."
  283.          Top             =   1260
  284.          Width           =   2310
  285.       End
  286.       Begin VB.HScrollBar hsbY 
  287.          Height          =   240
  288.          Left            =   270
  289.          Max             =   50
  290.          Min             =   -50
  291.          TabIndex        =   19
  292.          Tag             =   "Adjusts the up-down offset, allowing extra positioning control."
  293.          Top             =   1890
  294.          Width           =   2310
  295.       End
  296.       Begin VB.ComboBox cboAlignmentEx 
  297.          Height          =   315
  298.          ItemData        =   "Pictures.frx":208E
  299.          Left            =   270
  300.          List            =   "Pictures.frx":20AD
  301.          Style           =   2  'Dropdown List
  302.          TabIndex        =   15
  303.          Tag             =   "Allows you to modify the default alignment position of the graphic"
  304.          Top             =   585
  305.          Width           =   1815
  306.       End
  307.       Begin VB.Label lblHdr 
  308.          AutoSize        =   -1  'True
  309.          Caption         =   "PictureOffsetX"
  310.          Height          =   195
  311.          Index           =   4
  312.          Left            =   270
  313.          TabIndex        =   16
  314.          Top             =   1035
  315.          Width           =   1050
  316.       End
  317.       Begin VB.Label lblHdr 
  318.          AutoSize        =   -1  'True
  319.          Caption         =   "PictureOffsetY"
  320.          Height          =   195
  321.          Index           =   5
  322.          Left            =   270
  323.          TabIndex        =   18
  324.          Top             =   1665
  325.          Width           =   1050
  326.       End
  327.       Begin VB.Label lblHdr 
  328.          AutoSize        =   -1  'True
  329.          Caption         =   "PictureAlignment:"
  330.          Height          =   195
  331.          Index           =   6
  332.          Left            =   270
  333.          TabIndex        =   14
  334.          Top             =   360
  335.          Width           =   1260
  336.       End
  337.    End
  338.    Begin CommandButtonXDemo.pucLogoPane LogoPane1 
  339.       Align           =   1  'Align Top
  340.       Height          =   780
  341.       Left            =   0
  342.       Top             =   0
  343.       Width           =   6105
  344.       _ExtentX        =   10769
  345.       _ExtentY        =   1376
  346.       Picture         =   "Pictures.frx":2153
  347.    End
  348. Attribute VB_Name = "frmPictures"
  349. Attribute VB_GlobalNameSpace = False
  350. Attribute VB_Creatable = False
  351. Attribute VB_PredeclaredId = True
  352. Attribute VB_Exposed = False
  353. Option Explicit
  354. DefInt A-Z
  355. Private Sub cboAlignmentEx_Click()
  356.  cmdxDemo.PictureAlignment = cboAlignmentEx.ListIndex
  357. End Sub
  358. Private Sub cboAlignmentEx_GotFocus()
  359.  tipPicture.Text = cboAlignmentEx.Tag
  360. End Sub
  361. Private Sub chkEnabled_Click()
  362.  cmdxDemo.Enabled = chkEnabled
  363. End Sub
  364. Private Sub chkEnabled_GotFocus()
  365.  tipPicture.Text = chkEnabled.Tag
  366. End Sub
  367. Private Sub cmdAction_Click(Index As Integer)
  368.  Dim File$
  369.  Dim Pic As StdPicture
  370.  With cmdxDemo
  371.   'property for file
  372.   Select Case Index
  373.    Case 0, 2, 4, 6
  374.     File$ = SelectFile$(hWnd, "Pictures (*.bmp;*.dib;*.ico;*.gif;*.jpg;*.rle;*.wmf)|*.bmp;*.dib;*.gif;*.ico;*.jpg;*.rle;*.wmf|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Icons (*.ico)|*.ico|Windows Metafiles (*.wmf)|*.wmf|Internet Images (*.gif;*.jpg)|*.gif;*.jpg", "bmp", , "Browse Picture")
  375.     If Len(File$) Then
  376.      On Error Resume Next
  377.       Set Pic = LoadPicture(File$)
  378.       If Err Then
  379.        MsgBox Error$
  380.       End If
  381.      On Error GoTo 0
  382.     End If
  383.   End Select
  384.   'action
  385.   Select Case Index
  386.    Case 0
  387.     If Not Pic Is Nothing Then
  388.      Set .Picture = Pic
  389.     End If
  390.    Case 1: Set .Picture = Nothing
  391.    Case 2
  392.     If Not Pic Is Nothing Then
  393.      Set .DisabledPicture = Pic
  394.     End If
  395.    Case 3: Set .DisabledPicture = Nothing
  396.    Case 4
  397.     If Not Pic Is Nothing Then
  398.      Set .DownPicture = Pic
  399.     End If
  400.    Case 5: Set .DownPicture = Nothing
  401.    Case 6
  402.     If Not Pic Is Nothing Then
  403.      Set .HoverPicture = Pic
  404.     End If
  405.    Case 7: Set .HoverPicture = Nothing
  406.   End Select
  407.  End With
  408. End Sub
  409. Private Sub cmdAction_GotFocus(Index As Integer)
  410.  tipPicture.Text = cmdAction(Index).Tag
  411. End Sub
  412. Private Sub cmdClose_Click()
  413.  Unload Me
  414. End Sub
  415. Private Sub cmdClose_GotFocus()
  416.  tipPicture.Text = cmdClose.Tag
  417. End Sub
  418. Private Sub cmdxDemo_GotFocus()
  419.  tipPicture.Text = cmdxDemo.Tag
  420. End Sub
  421. Private Sub Form_Load()
  422.  cboAlignmentEx.ListIndex = cmdxDemo.PictureAlignment
  423. End Sub
  424. Private Sub hsbX_Change()
  425.  cmdxDemo.PictureOffsetX = hsbX
  426. End Sub
  427. Private Sub hsbX_GotFocus()
  428.  tipPicture.Text = hsbX.Tag
  429. End Sub
  430. Private Sub hsbX_Scroll()
  431.  hsbX_Change
  432. End Sub
  433. Private Sub hsbY_Change()
  434.  cmdxDemo.PictureOffsety = hsbY
  435. End Sub
  436. Private Sub hsbY_GotFocus()
  437.  tipPicture.Text = hsbY.Tag
  438. End Sub
  439. Private Sub hsbY_Scroll()
  440.  hsbY_Change
  441. End Sub
  442.