Questions tagged [sender]

sender is the conventional name of an input parameter to an event handler in some object-oriented languages and their frameworks, for example Objective-C and Cocoa, or C# and .NET.

See:

Event Handling in Cocoa

Events (C# Programming Guide)

328 questions
5
votes
3 answers

C# finding sender

private void buttonCheck(object sender, EventArgs e) { Type x = sender.GetType(); var y = Activator.CreateInstance(x); //sends me back to the original problem : sender is an object, not a usable object. var x = (Button)sender; // ==…
smitten
  • 51
  • 1
  • 5
4
votes
2 answers

How to get button.tag via longPressGestureRecognizer?

I'm dynamically adding image buttons to some scrollview. They all point at one longPressHandler. Now, how do I get which button was pressed? The [sender tag] gives me the tag of longGestureRecognizer that I added to button and I can't manually set…
yosh
  • 3,245
  • 7
  • 55
  • 84
4
votes
0 answers

MailGun sender domain

First sorry for my English level... I have a platform which send mail when a client sign in. I use mailgun. Send works with domains like hotmail, gmail or ***.net (which is based on gmail). But when I try to send to domain like ***.eu it doesn't…
4
votes
4 answers

Trying to update one textbox from another and vice-versa C# Winforms

I have two textboxes on a Winform. The idea is to enter Fahrenheit in one box and have it present Celcius in the other as the user types, and vice versa. I have it working fine using the 'Leave' method of the textbox but I was trying to use the…
Cimbian
  • 173
  • 2
  • 3
  • 12
4
votes
1 answer

Method to determine id of sender

I have code that works but I want to make sure I am doing things properly and cleanly. I have four versions of the same collection of views displayed on a screen. Each collection which will be used to control the volume and rate of four different…
ChemDev
  • 827
  • 1
  • 8
  • 23
3
votes
3 answers

iOS - passing Sender (button) name to addSubview

I have a main view with 3 buttons. Clicking on any of the buttons adds a SubView. The buttons have different titles and are all linked to IBAction "switchView" The "switchView" code is below. - (IBAction)switchView:(id)sender{ secondView…
user885483
  • 107
  • 1
  • 2
  • 10
3
votes
2 answers

Best method to determine the sender of an event

I have a simple question about event handling in iOS applications... suppose you have an app with some buttons that react to the TouchUpInside event calling the same action, what is the best way within the action method to understand what is the…
Gianni Costanzi
  • 6,054
  • 11
  • 48
  • 74
3
votes
3 answers

How can I optimize this code by using SENDER?

I have a form that contains 16 TCheckBox and 32 TEditBox. Every 2 TEditBox en-ability is depending of the checkBox state. so I uses this code which is too long: //T1 procedure TOFAddForm.T1Click(Sender: TObject); begin Q1.Enabled:=T1.Checked; …
3
votes
1 answer

Referencing a button when the action's sender is a UIGestureRecognizer

I've got a button called myButton and I gave it a UIGestureRecognizer so that an IBAction is only run when myButton is pressed with two fingers: UIGestureRecognizer *tapper = [[UITapGestureRecognizer alloc] initWithTarget:self…
hemlocker
  • 1,012
  • 1
  • 9
  • 24
3
votes
1 answer

Post notification with sender and object

I cannot seem to find out how to post a notification with an object and a sender. I can post a notification with a name, sender and user info. See: - (void)postNotificationName:(NSString *)notificationName …
Mats Stijlaart
  • 5,058
  • 7
  • 42
  • 58
3
votes
0 answers

How to send custom headers or authenticate Chromecast

I'm developing a video application with HLS streams. These streams can only be played if I send in the request https custom headers. On iOS I do like this: NSMutableDictionary* headers = [NSMutableDictionary dictionary]; [headers…
3
votes
1 answer

Java Mail "From" sender name bad character ÃÃÃÃÃ

I try to send a mail with following code snippet: message = new MimeMessage(mailSession); message.setFrom(from); message.setRecipients(Message.RecipientType.TO, to); if(cc != null && cc.length > 0){ …
Adrien Ruffie
  • 195
  • 4
  • 16
3
votes
1 answer

Unable to receive SNMPv3 Traps few times after the first Send. [snmp4j-Java]

I'm struggling from past few days to send SNMPV3 trap using Auth and priv phrase. The problem is : After i receive the first Trap SNMPv3 with Auth-Priv, i cannot receive the trap after sometimes (about 2minutes) . The receiver is like ignoring every…
3
votes
2 answers

How to get the sender's name of an NSButton

I have several NSButtons that are attached to a single IBAction. I need to differentiate inside the method between the different buttons. I tried the following, but it doesn't work: for (int i = 0; i++; i < 7) { if (sender == [NSString…
node ninja
  • 31,796
  • 59
  • 166
  • 254
3
votes
1 answer

How to identify which control is Sender?

I use common procedures for all Virtual Treeviews (TVirtualStringTree) so I only have 1 code to maintain, like for OnClick I use Common_VST_OnClick which all VST controls has set: procedure TForm1.Common_VST_OnClick(Sender: TObject); And to execute…
Mike Torrettinni
  • 1,816
  • 2
  • 17
  • 47
1
2
3
21 22