Author Topic: Why a button cant run a function but CommandMethod can?  (Read 1677 times)

0 Members and 1 Guest are viewing this topic.

ekoneo

  • Newt
  • Posts: 66
Why a button cant run a function but CommandMethod can?
« on: July 18, 2018, 10:23:33 AM »
Hi,

I cant create a label by clicking a button1. But I can create a label with "RunFunction" command. Why the button can not create a label.

Code: [Select]
[CommandMethod("RunFunction")]
        public void function()
        {
            createPointLabelStyle("Demo");
        }
private void button1_Click(object sender, EventArgs e)
        {
ObjectId styleId = CivDoc.Styles.LabelStyles.PointLabelStyles.LabelStyles.Add("ekoneo");
}


I am going crazy  :idiot2:

Thanks.

ekoneo

  • Newt
  • Posts: 66
Re: Why a button cant run a function but CommandMethod can?
« Reply #1 on: July 18, 2018, 11:07:08 AM »
Searching about that took all day :? Google gave result :)

Code: [Select]
DocumentLock docLock = doc.LockDocument();

{
Code
}

Thanks.

Newmanz

  • Guest
Re: Why a button cant run a function but CommandMethod can?
« Reply #2 on: July 23, 2018, 03:58:01 AM »
I want to know the source of the information and to publish this information, can I ask more?

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.