Professional Documents
Culture Documents
54 Right Click Context Menu Example
54 Right Click Context Menu Example
n Transcrip
pt Chandoo.org
Right Click Con
ntext Me
enu exam
mple
[00:00:001 minutes]
[00:00:553 minutes]
[00:02:004 minutes]
[00:03:554 minutes]
Let's seee what all wee have done
e here. We hhave put in a calendar co
ontrol which is here and we have
put in a command b button. Do we have any ccode? The co dMe, i.e. pleease remove this user
ode is Unload
Page 1 off 4
Lesson
n Transcrip
pt Chandoo.org
form froom the screeen. When we w press Escc from the keyboard, th he way this event triggers is by
specifyinng the Canceel property o of this commmand button n. If we bring g up the prooperties box,, you can
see thatt the Cancel property forr this commaand button h has been spe ecified as truue which me eans that
whenever we press the Esc key,, the code thhat we have written in C ClickEvent wiill be triggered. Right
now, thee only line th hat we have is UnloadM e and so the e form gets u unloaded froom the scree en. How I
get this month‐view w control is pretty
p simplee. I can clickk on this buttton called ttoolbox. First of all, I
need to bring up th
he toolbox control bar oon the scree en. So, we ca an go to Vieew and then n click on
toolbox or we can click on the toolbox buttoon here. Now w, once the toolbox is onn the screen n, we can
then either go to thee Tools menu and click oon Additional Controls or we can righht click on the e toolbar
and chooose Additional Controlss. They both will bring up u the additional controols dialog bo ox on the
screen u using which wwe can select any of the options thatt are availablle on our sysstem to use.
[00:05:444 minutes]
[00:09:001 minutes]
Page 2 off 4
Lesson
n Transcrip
pt Chandoo.org
[00:10:337 minutes]
[00:12:445 minutes]
We startt with On Error Resume Next so thatt if there is an error, it go
oes to the neext line. Then
n, we are
using th
he Command dBarControl o
object and wwe are creatting a new variable calleed NewContrrol. Next,
Page 3 off 4
Lesson
n Transcrip
pt Chandoo.org
[00:16:331 minutes]
We are specifying that the Ctrl+Shift+C keyy should nott run anythin ng and we aare also dele
eting the
InsertDaate option th hat we have added. Withh all these liines of code, we are now w able to addd a right
click meenu option to Date and wheenever we choose date, it will appeaar in the cell. If I right
o this InsertD
click in any other reegion which is not a parrt of the datta table, I do not see thhe InsertDatte option
becausee this contexxt menu is applicable
a too a cell and when we click on a datta table, thee context
menu is applicable to the List Range pop‐up..
[00:17:447 minutes]
Page 4 off 4