Difference between revisions of "Lua:createButton"

From Cheat Engine
Jump to navigation Jump to search
m (Added related function template.)
m (Examples: Syntax Highlight.)
 
Line 21: Line 21:
  
 
===Examples===
 
===Examples===
<pre>
+
<syntaxhighlight lang="lua" line>
 
local form = createForm()
 
local form = createForm()
 
local button = createButton(form)
 
local button = createButton(form)
 
button.Caption = "Run"
 
button.Caption = "Run"
 
button.OnClick = function() showMessage("Clicked") end
 
button.OnClick = function() showMessage("Clicked") end
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
 
{{Creation}}
 
{{Creation}}

Latest revision as of 00:56, 27 June 2026

<> Lua API Reference

function createButton(owner) : Button

Creates a Button control.

The new Button belongs to the supplied owner. The owner must inherit from WinControl.

Function Parameters[edit]

Parameter Type Description
owner WinControl The parent/owner of the new Button.

Returns[edit]

Button — The newly created Button object.

Examples[edit]

1 local form = createForm()
2 local button = createButton(form)
3 button.Caption = "Run"
4 button.OnClick = function() showMessage("Clicked") end

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Basic Visual Controls

Text / Input Controls

Value / Progress Controls

Graphics / Resources

Strings / Streams

Timers / Hotkeys

Scanning / Found Lists

Other Creation Helpers