2 Replies - 691 Views - Last Post: 15 November 2016 - 07:39 AM

#1 Eoaneh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 12-November 16

How to create custom events

Posted 12 November 2016 - 11:11 PM

Hi

I was looking for how to create custom events and I found this post.And I found it really useful.
But I have a problem witch seems not to have a logical reason,I tried to write my own custom event based on yours(because it was technically like yours)and it didn't work, then I thought maybe when I was customizing it I've made mistakes, then I simplified it, it didn't work either. Then I made a new project of your project and it worked. so I put your codes into mine but it still doesn't work.
And the problem actually is when the event fires, something like :
UpdateTextControl(this, args);

executes, it should go where we defined the method, like :
private: System::Void UpdateControl(System::Object^ sender, CustomEvents_EventArgs^ e) {
					 m_textBox->Text = e->TextControlText();

should be executed. but in my project it doesn't run this two lines, and I don't know why.

I was wondering if you you could help me?

Is This A Good Question/Topic? 0
  • +

Replies To: How to create custom events

#2 Eoaneh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 12-November 16

Re: How to create custom events

Posted 12 November 2016 - 11:17 PM

Hi

I was looking for how to create custom events and I found this post.And I found it really useful.
But I have a problem witch seems not to have a logical reason,I tried to write my own custom event based on yours(because it was technically like yours)and it didn't work,
Then I thought maybe when I was customizing it I've made mistakes, then I simplified it, it didn't work either. Then I made a new project of your project and it worked. so I put your codes into mine but it still doesn't work.
And the problem actually is when the event fires, something like :
UpdateTextControl(this, args);

executes, it should go where we defined the method, like :
private: System::Void UpdateControl(System::Object^ sender, CustomEvents_EventArgs^ e) {
					 m_textBox->Text = e->TextControlText();

and execute this.
But in my project it doesn't run this two lines, and I don't know why.

I was wondering if you you could help me?

P.S. I have written all you have into my project and it does't have errors; it runs but it does't run just this two lines after the code
 UpdateTextControl
runs.
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,479
  • Joined: 12-June 08

Re: How to create custom events

Posted 15 November 2016 - 07:39 AM

Split from this topic of six years ago.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1