1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563
| Option Explicit
'Private m_clsEvents As Collection
Private m_objParent As clsEvents
'Prendre l'habitude de mettre "MSForms." pour ne pas générer d'erreurs. En effet les objets de type TextBox sont différents des objets de type MSForms.TextBox
Private WithEvents m_objLbl As MSForms.Label 'Variable qui correspond aux label(s) du formulaire
Private WithEvents m_objChk As MSForms.CheckBox 'Variable qui correspond aux checkbox(s) du formulaire
Private WithEvents m_objCbo As MSForms.ComboBox 'Variable qui correspond aux ComboBox(s) du formulaire
Private WithEvents m_objImg As MSForms.Image 'Variable qui correspond aux Image(s) du formulaire
Private WithEvents m_objLst As MSForms.ListBox 'Variable qui correspond aux ListBox(s) du formulaire
Private WithEvents m_objMtp As MSForms.MultiPage 'Variable qui correspond aux MultiPage(s) du formulaire
Private WithEvents m_objOpt As MSForms.OptionButton 'Variable qui correspond aux OptionButton(s) du formulaire
Private WithEvents m_objCmd As MSForms.CommandButton 'Variable qui correspond aux CommandButton(s) du formulaire
Private WithEvents m_objTxt As MSForms.TextBox 'Variable qui correspond aux TextBox(s) du formulaire
Private WithEvents m_objSpn As MSForms.SpinButton 'Variable qui correspond aux SpinButton(s) du formulaire
'A la fin de la classe, libère les objets de la mémoire
Private Sub class_Terminate()
Set m_objParent = Nothing
Set m_objLbl = Nothing
Set m_objChk = Nothing
Set m_objCbo = Nothing
Set m_objImg = Nothing
Set m_objLst = Nothing
Set m_objMtp = Nothing
Set m_objOpt = Nothing
Set m_objCmd = Nothing
Set m_objTxt = Nothing
Set m_objSpn = Nothing
End Sub
'Permet d'ajouter un Control en fonction du type et de le set dans la variable de module
Public Property Set AjoutControl(ByVal objControl As Control)
Select Case TypeName(objControl)
Case "Label"
Set m_objLbl = objControl
Case "CheckBox"
Set m_objChk = objControl
Case "ComboBox"
Set m_objCbo = objControl
Case "Image"
Set m_objImg = objControl
Case "ListBox"
Set m_objLst = objControl
Case "MultiPage"
Set m_objMtp = objControl
Case "OptionButton"
Set m_objOpt = objControl
Case "CommandButton"
Set m_objCmd = objControl
Case "TextBox"
Set m_objTxt = objControl
Case "SpinButton"
Set m_objSpn = objControl
End Select
Set objControl = Nothing
End Property
'Set un objet parent de type clsEvents
Property Set Parent(ByRef objEvents As clsEvents)
Set m_objParent = objEvents
End Property
'Get l'objet parent de type clsEvents
Property Get Parent() As clsEvents
Parent = m_objParent
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des Label(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objLbl_Click()
EvenementAExecuter "Click", m_objLbl
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des CheckBox(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objChk_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDragOver", m_objChk, Cancel, Data, X, Y, DragState, Effect, Shift
End Sub
Private Sub m_objChk_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objChk, Cancel, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objChk_Change()
EvenementAExecuter "Change", m_objChk
End Sub
Private Sub m_objChk_Click()
EvenementAExecuter "Click", m_objChk
End Sub
Private Sub m_objChk_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
EvenementAExecuter "DblClick", m_objChk, Cancel
End Sub
Private Sub m_objChk_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objChk, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objChk_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyDown", m_objChk, KeyCode, Shift
End Sub
Private Sub m_objChk_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
EvenementAExecuter "KeyPress", m_objChk, KeyAscii
End Sub
Private Sub m_objChk_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyUp", m_objChk, KeyCode, Shift
End Sub
Private Sub m_objChk_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseDown", m_objChk, Button, Shift, X, Y
End Sub
Private Sub m_objChk_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseMove", m_objChk, Button, Shift, X, Y
End Sub
Private Sub m_objChk_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseUp", m_objChk, Button, Shift, X, Y
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des ComboBox(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objCbo_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objCbo, Cancel, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objCbo_Change()
EvenementAExecuter "Change", m_objCbo
End Sub
Private Sub m_objCbo_Click()
EvenementAExecuter "Click", m_objCbo
End Sub
Private Sub m_objCbo_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
EvenementAExecuter "DblClick", m_objCbo, Cancel
End Sub
Private Sub m_objCbo_DropButtonClick()
EvenementAExecuter "DropButtonClick", m_objCbo
End Sub
Private Sub m_objCbo_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objCbo, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objCbo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyDown", m_objCbo, KeyCode, Shift
End Sub
Private Sub m_objCbo_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
EvenementAExecuter "KeyPress", m_objCbo, KeyAscii
End Sub
Private Sub m_objCbo_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyUp", m_objCbo, KeyCode, Shift
End Sub
Private Sub m_objCbo_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseDown", m_objCbo, Button, Shift, X, Y
End Sub
Private Sub m_objCbo_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseMove", m_objCbo, Button, Shift, X, Y
End Sub
Private Sub m_objCbo_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseUp", m_objCbo, Button, Shift, X, Y
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des Image(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objImg_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDragOver", m_objImg, Cancel, Data, X, Y, DragState, Effect, Shift
End Sub
Private Sub m_objImg_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objImg, Cancel, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objImg_Click()
EvenementAExecuter "Click", m_objImg
End Sub
Private Sub m_objImg_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
EvenementAExecuter "DblClick", m_objImg, Cancel
End Sub
Private Sub m_objImg_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objImg, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objImg_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseDown", m_objImg, Button, Shift, X, Y
End Sub
Private Sub m_objImg_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseMove", m_objImg, Button, Shift, X, Y
End Sub
Private Sub m_objImg_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseUp", m_objImg, Button, Shift, X, Y
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des ListBox(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objLst_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDragOver", m_objLst, Cancel, Data, X, Y, DragState, Effect, Shift
End Sub
Private Sub m_objLst_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objLst, Cancel, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objLst_Change()
EvenementAExecuter "Change", m_objLst
End Sub
Private Sub m_objLst_Click()
EvenementAExecuter "Click", m_objLst
End Sub
Private Sub m_objLst_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
EvenementAExecuter "DblClick", m_objLst, Cancel
End Sub
Private Sub m_objLst_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objLst, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objLst_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyDown", m_objLst, KeyCode, Shift
End Sub
Private Sub m_objLst_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
EvenementAExecuter "KeyPress", m_objLst, KeyAscii
End Sub
Private Sub m_objLst_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyUp", m_objLst, KeyCode, Shift
End Sub
Private Sub m_objLst_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseDown", m_objLst, Button, Shift, X, Y
End Sub
Private Sub m_objLst_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseMove", m_objLst, Button, Shift, X, Y
End Sub
Private Sub m_objLst_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseUp", m_objLst, Button, Shift, X, Y
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des MultiPage(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objMtp_AddControl(ByVal Index As Long, ByVal Control As MSForms.Control)
EvenementAExecuter "AddControl", m_objMtp, Index, Control
End Sub
Private Sub m_objMtp_BeforeDragOver(ByVal Index As Long, ByVal Cancel As MSForms.ReturnBoolean, ByVal Control As MSForms.Control, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal state As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDragOver", m_objMtp, Index, Cancel, Control, Data, X, Y, state, Effect, Shift
End Sub
Private Sub m_objMtp_BeforeDropOrPaste(ByVal Index As Long, ByVal Cancel As MSForms.ReturnBoolean, ByVal Control As MSForms.Control, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objMtp, Index, Cancel, Control, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objMtp_Change()
EvenementAExecuter "Change", m_objMtp
End Sub
Private Sub m_objMtp_Click(ByVal Index As Long)
EvenementAExecuter "Click", m_objMtp, Index
End Sub
Private Sub m_objMtp_DblClick(ByVal Index As Long, ByVal Cancel As MSForms.ReturnBoolean)
EvenementAExecuter "DblClick", m_objMtp, Index, Cancel
End Sub
Private Sub m_objMtp_Error(ByVal Index As Long, ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objMtp, Index, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objMtp_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyDown", m_objMtp, KeyCode, Shift
End Sub
Private Sub m_objMtp_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
EvenementAExecuter "KeyPress", m_objMtp, KeyAscii
End Sub
Private Sub m_objMtp_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyUp", m_objMtp, KeyCode, Shift
End Sub
Private Sub m_objMtp_Layout(ByVal Index As Long)
EvenementAExecuter "Layout", m_objMtp, Index
End Sub
Private Sub m_objMtp_MouseDown(ByVal Index As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseDown", m_objMtp, Index, Button, Shift, X, Y
End Sub
Private Sub m_objMtp_MouseMove(ByVal Index As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseMove", m_objMtp, Index, Button, Shift, X, Y
End Sub
Private Sub m_objMtp_MouseUp(ByVal Index As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseUp", m_objMtp, Index, Button, Shift, X, Y
End Sub
Private Sub m_objMtp_RemoveControl(ByVal Index As Long, ByVal Control As MSForms.Control)
EvenementAExecuter "RemoveControl", m_objMtp, Index, Control
End Sub
Private Sub m_objMtp_Scroll(ByVal Index As Long, ByVal ActionX As MSForms.fmScrollAction, ByVal ActionY As MSForms.fmScrollAction, ByVal RequestDx As Single, ByVal RequestDy As Single, ByVal ActualDx As MSForms.ReturnSingle, ByVal ActualDy As MSForms.ReturnSingle)
EvenementAExecuter "Scroll", m_objMtp, Index, ActionX, ActionY, RequestDx, RequestDy, ActualDx, ActualDy
End Sub
Private Sub m_objMtp_Zoom(ByVal Index As Long, Percent As Integer)
EvenementAExecuter "Zoom", m_objMtp, Index, Percent
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des OptionButton(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objOpt_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDragOver", m_objOpt, Cancel, Data, X, Y, DragState, Effect, Shift
End Sub
Private Sub m_objOpt_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objOpt, Cancel, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objOpt_Change()
EvenementAExecuter "Change", m_objOpt
End Sub
Private Sub m_objOpt_Click()
EvenementAExecuter "Click", m_objOpt
End Sub
Private Sub m_objOpt_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
EvenementAExecuter "DblClick", m_objOpt, Cancel
End Sub
Private Sub m_objOpt_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objOpt, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objOpt_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyDown", m_objOpt, KeyCode, Shift
End Sub
Private Sub m_objOpt_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
EvenementAExecuter "KeyPress", m_objOpt, KeyAscii
End Sub
Private Sub m_objOpt_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyUp", m_objOpt, KeyCode, Shift
End Sub
Private Sub m_objOpt_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseDown", m_objOpt, Button, Shift, X, Y
End Sub
Private Sub m_objOpt_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseMove", m_objOpt, Button, Shift, X, Y
End Sub
Private Sub m_objOpt_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseUp", m_objOpt, Button, Shift, X, Y
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des CommandButton(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objCmd_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDragOver", m_objCmd, Cancel, Data, X, Y, DragState, Effect, Shift
End Sub
Private Sub m_objCmd_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objCmd, Cancel, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objCmd_Click()
EvenementAExecuter "Click", m_objCmd
End Sub
Private Sub m_objCmd_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
EvenementAExecuter "DblClick", m_objCmd, Cancel
End Sub
Private Sub m_objCmd_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objCmd, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objCmd_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyDown", m_objCmd, KeyCode, Shift
End Sub
Private Sub m_objCmd_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
EvenementAExecuter "KeyPress", m_objCmd, KeyAscii
End Sub
Private Sub m_objCmd_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyUp", m_objCmd, KeyCode
End Sub
Private Sub m_objCmd_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseDown", m_objCmd, Button, Shift, X, Y
End Sub
Private Sub m_objCmd_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseMove", m_objCmd, Button, Shift, X, Y
End Sub
Private Sub m_objCmd_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseUp", m_objCmd, Button, Shift, X, Y
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des TextBox(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objTxt_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDragOver", m_objTxt, Cancel, Data, X, Y, DragState, Effect, Shift
End Sub
Private Sub m_objTxt_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objTxt, Cancel, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objTxt_Change()
EvenementAExecuter "Change", m_objTxt
End Sub
Private Sub m_objTxt_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
EvenementAExecuter "DblClick", m_objTxt, Cancel
End Sub
Private Sub m_objTxt_DropButtonClick()
EvenementAExecuter "DropButtonClick", m_objTxt
End Sub
Private Sub m_objTxt_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objTxt, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objTxt_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyDown", m_objTxt, KeyCode, Shift
End Sub
Private Sub m_objTxt_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
EvenementAExecuter "KeyPress", m_objTxt, KeyAscii
End Sub
Private Sub m_objTxt_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyUp", m_objTxt, KeyCode, Shift
End Sub
Private Sub m_objTxt_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseDown", m_objTxt, Button, Shift, X, Y
End Sub
Private Sub m_objTxt_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseMove", m_objTxt, Button, Shift, X, Y
End Sub
Private Sub m_objTxt_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
EvenementAExecuter "MouseUp", m_objTxt, Button, Shift, X, Y
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Appel des procédures pour des SpinButton(s)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub m_objSpn_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDragOver", m_objSpn, Cancel, Data, X, Y, DragState, Effect, Shift
End Sub
Private Sub m_objSpn_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
EvenementAExecuter "BeforeDropOrPaste", m_objSpn, Cancel, Action, Data, X, Y, Effect, Shift
End Sub
Private Sub m_objSpn_Change()
EvenementAExecuter "Change", m_objSpn
End Sub
Private Sub m_objSpn_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
EvenementAExecuter "Error", m_objSpn, Number, Description, SCode, Source, HelpFile, HelpContext, CancelDisplay
End Sub
Private Sub m_objSpn_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyDown", m_objSpn, KeyCode, Shift
End Sub
Private Sub m_objSpn_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
EvenementAExecuter "KeyPress", m_objSpn, KeyAscii
End Sub
Private Sub m_objSpn_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
EvenementAExecuter "KeyUp", m_objSpn, KeyCode, Shift
End Sub
Private Sub m_objSpn_SpinUp()
EvenementAExecuter "SpinUp", m_objSpn
End Sub
Private Sub m_objSpn_SpinDown()
EvenementAExecuter "SpinDown", m_objSpn
End Sub
'Permet pour un évènement de control d'exécuter la procédure située dans l'USF correspondant (si cette procédure existe)
Private Sub EvenementAExecuter(strNomFonction As String, objAppelant As Object, ParamArray vntArgs() As Variant)
strNomFonction = TypeName(objAppelant) & "s_" & strNomFonction
If MacroExists(m_objParent.Usf.Name, strNomFonction) Then
On Error GoTo Erreur
CallByName m_objParent.Usf, strNomFonction, VbMethod, m_objSpn, vntArgs
End If
Exit Sub
Erreur:
Select Case Err.Number
Case 438
MsgBox "Je n'en mettrai pas mon clavier à couper, mais je crois que tu as laissé le mot Private devant :" & vbCrLf & "Sub " & strNomFonction & "()" & vbCrLf & vbCrLf & "Si c'est ça, merci de virer le mot ''Private'' ! :)" & vbCrLf & vbCrLf & "Sinon vas dans ''clsEvent'' et cherche la procédure ''EvenementAExecuter'' puis retire sous la ligne Erreur le Case 438 pour rechercher le problème"
Case 450
MsgBox "Le nombre d'arguments écrit n'est pas le bon !" & vbCrLf & vbCrLf & "Merci de suivre cette syntaxe :" & vbCrLf & "Sub " & strNomFonction & "(obj As Object, ParamArray vntArgs() As Variant)"
Case Else
On Error GoTo 0
Resume
End Select
End Sub |