lvbutton.ctl

来自「使用VB仿QQ界面开发的ICQ程序,采用C/S结架,实现简单文字聊天.」· CTL 代码 · 共 92 行

CTL
92
字号
VERSION 5.00
Begin VB.UserControl LaVolpeButton 
   AutoRedraw      =   -1  'True
   ClientHeight    =   630
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   1665
   ClipControls    =   0   'False
   DefaultCancel   =   -1  'True
   DrawStyle       =   2  'Dot
   KeyPreview      =   -1  'True
   PropertyPages   =   "LVbutton.ctx":0000
   ScaleHeight     =   42
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   111
   ToolboxBitmap   =   "LVbutton.ctx":002C
   Begin VB.PictureBox picIcon 
      AutoRedraw      =   -1  'True
      BorderStyle     =   0  'None
      Enabled         =   0   'False
      Height          =   300
      Left            =   0
      ScaleHeight     =   300
      ScaleWidth      =   315
      TabIndex        =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   315
   End
   Begin VB.Timer TimerHover 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   1215
      Top             =   0
   End
End
Attribute VB_Name = "LaVolpeButton"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "PropPageWizardRun" ,"Yes"
Option Explicit

' FYI: The code used to draw the buttons was borrowed from a project posted on PSC.
'   Although programmer claims to be the original author, most of the code was found among 3 other sites,
'   MSDN, A1VBcode, VBcode, posted by different authors... in some cases the code was an exact match,
'   in others, slight changes like variable names.

' Regardless, let it be known, that I did not write that part of the code.
' My contribution to this project...
'   <> inclusion of rotated buttons
'   <> inclusion of segmented buttons (horizontal only). Maybe when I get time, I'll include vertical 90,270 degree buttons also
'   <> inclusion of text styles: Emboss, Engrave & Shadow
'   <> 2 angles for rotated buttons (+\- 90 degrees), default style only, not segmented style
'   <> use of button icons, with left/right justification & disabled color
'   <> Replaced Ampersand/Hotkey function with more robust code to find hotkey regardless of number of ampersands in caption
'   <> Added property comments to appear at bottom of property sheet
'   <> Added built-in override of the Timer Control.  See TimerHover_Timer() for details.
'   <> corrected following logical errors to original code
'       - Allowed button drawing to occur only once during control loading
'           (before it would draw several times before it was actually displayed)
'       - Key strokes fired mouse clicks (key strokes should fire key strokes, mouse fires mouse)
'       - Redrawing/repainting before mouse clicks & keystrokes sent to parent
'       - If user right-clicked on button, button could not be activated by keyboard unless focus was lost & regained
'       - Java Button focus rectangle was fine for 1 line captions, but looked bad on 2-line buttons
'       - personal pref: removed MouseOver event (really same as MouseMove)
'       - when selecting custom color property while ColorScheme <> Custom, program now automatically selects Custom for you
'       - when returning to non-Custom colorscheme, program automatically resets all colors to that default
'       - when selecting a system vs palette color for any color property, the program
'          would make that color black, cause system colors are < 0 and no
'          actual color is < 0. Added function to convert system color to real color

' \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
' Changes in this revision of the program cannot be transferred directly... It is a complete rewrite
'   on how the control performs.

' This version reverts back to painting on demand or simply, when the status of a button changes. The previous version painted all buttons once,
'   but used more resources and had severe problems displaying in NT & Win2K.
' Frustrated by not being able to get it to work in NT forced me to try something else...
' I now use logical fonts created when needed. These logical fonts can be rotated assuming they are not System fonts. Lots of limitations,
'   but taken care of in extra programming and documented in those modules (WordWrapCaption, CreateDisplayFont, DetermineOS, DrawDisabledIcon)
' All but ONE capability has been carried over to this version... rotated icons when buttons are rotated. It was hard enough to get the disabled icon effect

' Note: When button attributes change via code, the button is forced to redraw, same as original project, although many options are read-only at runtime
' ////////////////////////////////////////////////////////////////////////////////////////////////////////////

' The following was cut & pasted from original project
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'%              <<< GONCHUKI SYSTEMS >>>              %
'%                                                    %
'%   CHAMELEON BUTTON - copyright 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?