DgsEditSetReadOnly

From Multi Theft Auto: Wiki

This function allows you to set or remove read-only status for a dgs edit box. If read-only is set to true, the box is not editable.

Syntax

bool dgsEditSetReadOnly ( element edit, bool status )

Required Arguments

  • edit: The dgs-dxedit that you want to apply.
  • status: A boolean value indicating whether read-only is to be enabled or disabled.

Returns

Returns true if edit field's read-only status was changed successfully, false otherwise.

Example

This example creates a little advert field on the bottom right corner of the screen and sets it to read only.

DGS = exports.dgs 
myWebsite = "development.mtasa.com" -- define the text to be displayed in advert field
function createAdvert( )
    local advert = DGS:dgsCreateEdit( 0.845, 0.94, 0.15, 0.05, myWebsite, true ) -- create edit field for the advert
    if advert then -- if it was successfully created
        DGS:dgsEditSetReadOnly( advert, true ) -- make it read only
    end
end
addEventHandler ( "onClientResourceStart", getResourceRootElement( getThisResource() ), createAdvert )

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D