home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Improved_C2066265182007.psc / ComboBoxEx32 / frmComboBoxEx.frm next >
Text File  |  2007-05-16  |  6KB  |  227 lines

  1. VERSION 5.00
  2. Begin VB.Form frmComboBoxEx 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   5130
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   8895
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5130
  10.    ScaleWidth      =   8895
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Command10 
  13.       Caption         =   "Clear"
  14.       Height          =   405
  15.       Left            =   5655
  16.       TabIndex        =   13
  17.       Top             =   2700
  18.       Width           =   1275
  19.    End
  20.    Begin VB.PictureBox Picture3 
  21.       Height          =   570
  22.       Left            =   7200
  23.       Picture         =   "frmComboBoxEx.frx":0000
  24.       ScaleHeight     =   510
  25.       ScaleWidth      =   765
  26.       TabIndex        =   12
  27.       Top             =   795
  28.       Width           =   825
  29.    End
  30.    Begin VB.CommandButton Command9 
  31.       Caption         =   "Style drop dwon list"
  32.       Height          =   525
  33.       Left            =   7200
  34.       TabIndex        =   11
  35.       Top             =   3240
  36.       Width           =   1590
  37.    End
  38.    Begin VB.CommandButton Command8 
  39.       Caption         =   "Style dropdown"
  40.       Height          =   540
  41.       Left            =   5640
  42.       TabIndex        =   10
  43.       Top             =   3210
  44.       Width           =   1425
  45.    End
  46.    Begin VB.ComboBox Combo1 
  47.       Height          =   315
  48.       Left            =   1605
  49.       TabIndex        =   9
  50.       Text            =   "Combo1"
  51.       Top             =   2100
  52.       Width           =   1320
  53.    End
  54.    Begin VB.CommandButton Command7 
  55.       Caption         =   "Change Selected Item"
  56.       Height          =   555
  57.       Left            =   7110
  58.       TabIndex        =   8
  59.       Top             =   2445
  60.       Width           =   1425
  61.    End
  62.    Begin VB.CommandButton Command6 
  63.       Caption         =   "Select Item 2"
  64.       Height          =   435
  65.       Left            =   7125
  66.       TabIndex        =   7
  67.       Top             =   1920
  68.       Width           =   1440
  69.    End
  70.    Begin VB.CommandButton Command5 
  71.       Caption         =   "Drop Down "
  72.       Height          =   450
  73.       Left            =   5535
  74.       TabIndex        =   6
  75.       Top             =   2205
  76.       Width           =   1305
  77.    End
  78.    Begin VB.CommandButton Command4 
  79.       Caption         =   "Selected Item"
  80.       Height          =   375
  81.       Left            =   5550
  82.       TabIndex        =   5
  83.       Top             =   1725
  84.       Width           =   1365
  85.    End
  86.    Begin VB.CommandButton Command3 
  87.       Caption         =   "Delete Last Item"
  88.       Height          =   390
  89.       Left            =   5565
  90.       TabIndex        =   4
  91.       Top             =   1230
  92.       Width           =   1365
  93.    End
  94.    Begin VB.CommandButton Command2 
  95.       Caption         =   "Add item"
  96.       Height          =   390
  97.       Left            =   5490
  98.       TabIndex        =   3
  99.       Top             =   720
  100.       Width           =   1395
  101.    End
  102.    Begin VB.CommandButton Command1 
  103.       Caption         =   "get Count"
  104.       Height          =   405
  105.       Left            =   5505
  106.       TabIndex        =   2
  107.       Top             =   210
  108.       Width           =   1455
  109.    End
  110.    Begin VB.PictureBox Picture2 
  111.       Height          =   390
  112.       Left            =   7680
  113.       Picture         =   "frmComboBoxEx.frx":0442
  114.       ScaleHeight     =   330
  115.       ScaleWidth      =   345
  116.       TabIndex        =   1
  117.       Top             =   180
  118.       Width           =   405
  119.    End
  120.    Begin VB.PictureBox Picture1 
  121.       Height          =   420
  122.       Left            =   7125
  123.       Picture         =   "frmComboBoxEx.frx":0544
  124.       ScaleHeight     =   360
  125.       ScaleWidth      =   360
  126.       TabIndex        =   0
  127.       Top             =   90
  128.       Width           =   420
  129.    End
  130. End
  131. Attribute VB_Name = "frmComboBoxEx"
  132. Attribute VB_GlobalNameSpace = False
  133. Attribute VB_Creatable = False
  134. Attribute VB_PredeclaredId = True
  135. Attribute VB_Exposed = False
  136. ' ======================================================================================
  137. ' Name:     modComboBoxEx.bas
  138. ' Author:   Joshy Francis (joshylogicss@yahoo.co.in)
  139. ' Date:     3 March 2007
  140. '
  141. ' Requires: None
  142. '
  143. ' Copyright ⌐ 2000-2007 Joshy Francis
  144. ' --------------------------------------------------------------------------------------
  145. 'The implementation of ComboBoxEx in VB.All by API.
  146. 'you can freely use this code anywhere.But I wants you must include the copyright info
  147. 'All functions in this module written by me.
  148. ' --------------------------------------------------------------------------------------
  149. 'No updates.This is the first version.
  150. 'I Just included comments on every important lines.Sorry for my bad english.
  151. 'I developed this program by converting the C Documentation to VB and experiments with VB.
  152. 'You can improve this program by your experiments.I didn't done all parts of the
  153. 'ComboBoxEx.
  154. Option Explicit
  155.  
  156. Private Sub Command1_Click()
  157. MsgBox GetCount
  158. End Sub
  159.  
  160. Private Sub Command10_Click()
  161. Clear
  162. End Sub
  163.  
  164. Private Sub Command2_Click()
  165. InsertItem "Item " & GetCount, , (Rnd * 1) * 1, (Rnd * 1) * 1, Rnd * 6
  166. End Sub
  167.  
  168. Private Sub Command3_Click()
  169. DelItem GetCount - 1
  170. End Sub
  171.  
  172. Private Sub Command4_Click()
  173. Dim i As Long
  174.     i = GetSelItem
  175. MsgBox GetItemText(i), , i
  176. End Sub
  177.  
  178. Private Sub Command5_Click()
  179. DropDown
  180. End Sub
  181.  
  182. Private Sub Command6_Click()
  183. SelItem 1
  184. End Sub
  185.  
  186. Private Sub Command7_Click()
  187. Dim i As Long
  188.     i = GetSelItem
  189. SetItemText "Changed Item " & i, i
  190. End Sub
  191.  
  192. Private Sub Command8_Click()
  193. Dim stl As Long
  194. stl = GetWindowLong(Wnd, GWL_STYLE)
  195.  
  196. If (stl And CBS_DROPDOWNLIST) = CBS_DROPDOWNLIST Then
  197.     stl = stl And Not CBS_DROPDOWNLIST
  198. End If
  199. If (stl And CBS_DROPDOWN) = CBS_DROPDOWN Then
  200. Else
  201.     stl = stl Or CBS_DROPDOWN
  202. End If
  203.  
  204. SetWindowLong Wnd, GWL_STYLE, stl
  205. End Sub
  206.  
  207. Private Sub Command9_Click()
  208. Dim stl As Long
  209. stl = GetWindowLong(Wnd, GWL_STYLE)
  210. If (stl And CBS_DROPDOWN) = CBS_DROPDOWN Then
  211.     stl = stl And Not CBS_DROPDOWN
  212. End If
  213. If (stl And CBS_DROPDOWNLIST) = CBS_DROPDOWNLIST Then
  214. Else
  215.     stl = stl Or CBS_DROPDOWNLIST
  216. End If
  217. SetWindowLong Wnd, GWL_STYLE, stl
  218. End Sub
  219.  
  220. Private Sub Form_Load()
  221. CreateComboBoxEx hwnd
  222. End Sub
  223.  
  224. Private Sub Form_Unload(Cancel As Integer)
  225. DestroyComboBoxEx
  226. End Sub
  227.