# com

## The basics

Basicly add method.

* access {Def: public}
* args {Def: {}}
* name {Def: String.Empty}
* code {Def: String.Empty}
* isfield {Def: false}
* returntype {Def: void}
* fielddefualt {Def: String.Empty}

```
com new method -> $windowName as cs:
"name": "methodname",
"args": "sender, e",
"code": "

MessageBox.Show(\"Hi\");

".
;
```

<details>

<summary>Rule</summary>

```
[new]
[method]
[->]
[$]
[as]
[cf|ps|cs]
[:]
[":"]
```

</details>

## Example

```

//Made with BH

set $windowName (window):
"Title": "Calc",
"Width": "270",
"Height": "330"
;

com new method -> $windowName as cs:
"name": "methodname",
"args": "sender, e",
"code": "

MessageBox.Show(\"Hi\");

".
;

app new comp -> $windowName as Button:
"inner": "1",
"Width": "50",
"Height": "50",
"Click": "methodname".
;

show $windowName;
//Coded with BH Beta 0.5.2
```

<figure><img src="https://542074667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FezZNV4uHyq0cjDgDRxMD%2Fuploads%2F7tSWQrk5TC6x1ELZnwlV%2Fh2.png?alt=media&#x26;token=030f720f-4d9b-4f9c-8566-1a20a2de8bb6" alt=""><figcaption></figcaption></figure>

{% code title="Output:" %}

```
```

{% endcode %}
