logo       

Re: Handling lots of menu entries: msg#00394

windows.devel.dotnet.winforms

Subject: Re: Handling lots of menu entries

Richard Heintze schrieb:

I wanted to add the ability to change the opacity to
my GUI app. I added a 10 of menu entries with 10
handlers. It was grotesque! Is there a better way?

void Form1::Opacity100(System::Object* s,
System::EventArgs* e){
Opacity = 1.0;
}
void Form1::Opacity90(System::Object* s,
System::EventArgs* e){
Opacity = .9;
}
void Form1::Opacity80(System::Object* s,
System::EventArgs* e){
Opacity = .8;
}

Yes, I believe you should be able to create one event handler and check
the "sender" argument ("s" in your code).

Fabian



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise