Garry's Mod Wiki


void DLabel:DoRightClick()


Called when the label is right clicked (on key release) by the player.

This will be called after DLabel:OnDepressed and DLabel:OnReleased.

See also DLabel:DoClick, DLabel:DoMiddleClick and DLabel:DoDoubleClick.


Creates a label in the center of the screen, that prints I was right clicked! to the console and disappears when right clicked.

local lbl = vgui.Create( "DLabel" ) lbl:SetFont( "DermaLarge" ) lbl:SetText( "Click me!" ) lbl:SizeToContents() lbl:Center() lbl:SetMouseInputEnabled( true ) function lbl:DoRightClick() print("I was right clicked!") self:Remove() end
I was clicked!

When the label is right clicked.

Page Links

Special Pages



Render Time: 29ms

Session 0
DB GetPage 3
Generate Html 2
SaveChanges 10
Render Body 0
Render Sidebar 11