event-handling

Why does IE add a jQuery attribute for server-side element with mouseover handler?

≯℡__Kan透↙ 提交于 2019-12-02 05:57:32
问题 This isn't a crucial piece of knowledge for me, but I would still like to know what exactly is happening here. This is a .NET 3.5 Web Forms application. One of the pages has 3 server-side inputs with type 'submit'. Each one of these inputs has the following JavaScript handlers assigned to them with jQuery: $('.button').mouseover(function() { $(this).addClass('hoverEffect'); }); $('.button').mouseout(function() { $(this).removeClass('hoverEffect'); }); When I run the following script (yes,

Add completion handler to presentViewControllerAsSheet(NSViewController)?

落花浮王杯 提交于 2019-12-02 05:45:11
问题 I am attempting to present a sheet configuration view ( AddSoundEffect ) for my main window/view controller (I'm using storyboards), and when the configuration view controller is dismissed, take the values entered in the AddSoundEffect view and pass that back to the main view. My current code in the main view controller: presentViewControllerAsSheet(self.storyboard!.instantiateControllerWithIdentifier("AddSoundEffect") as! AddSoundViewController And in the AddSoundViewController.swift file,

Updating the listbox after adding a new item

只愿长相守 提交于 2019-12-02 05:42:10
I am using WPF and C# I have a button that opens a window, which also includes a button that adds an User object item to a listbox and I want the listbox index to be updated after insertion. I understood that the solution is about using observable class of INotifyCollectionChanged but actually I dont know how and where to use them. Can you help me on determining what and where to implement, register, fire etc. Edit: I succeeded this by Quartermeister's help where my User object is collected in a list, but now I want to do the same thing where my object is collected in a dictionary The easiest

Dynamic created Buttons VB.Net with Loop

我与影子孤独终老i 提交于 2019-12-02 05:38:06
I have a very strange Problem with dynamic created Buttons in VB.NET: The Click Event is not fired when creating them in a Loop. Here is my code: Panel1.Controls.Clear() For i As Integer = 0 To 100 Step 1 Dim b15 As new Button b15.Text = "Test3" b15.id = "a" & i AddHandler b15.Click, AddressOf updateFunc Panel1.Controls.Add(b15) Next This one doesn't work (only the PageLoad is fired, not the Click Event), but when i type Dim b14 As New Button b14.Text = "Test" b14.id = "asdf" AddHandler b14.Click, AddressOf updateFunc Panel1.Controls.Add(b14) it works fine and the Event is fired. The Header of

How to unit test (in C#) that a button is clicked?

假如想象 提交于 2019-12-02 05:15:19
问题 I have a user control that has button whose click event handler contains the core logic. I want to test this button click handler. This handler function calls a public function of another user control (which resides in separate C# project) which ultimately calls public function of a reference assembly. Can anyone please tell me - how will be the unit test for such a handler? 回答1: You can write a method that programmatically raises the Click event and call that from your unit test. Edit: Ah,

Is there a better way to set an initial position for a JPanel graphic?)

不问归期 提交于 2019-12-02 05:10:53
问题 In Chapter 15 of Liang's Intro to Java Programming (7th ed.) , he introduces a program to make a (2-D) ball on a JPanel and enlarge it upon clicking enlarge/shrink buttons. I've modified the program so that it also 1) enlarges/shrinks the ball if the user clicks/option+clicks, 2) allows you to pick the color of the ball by pressing a button, and 3) allows you to move the circle by dragging it with your mouse. The last modification is what was giving me trouble for a while, because I wanted to

Open MediaPlayer - event unhandled in Thread

南笙酒味 提交于 2019-12-02 04:53:11
I'm trying to create a media player (with Media.MediaPlayer() class) and for this I am using a thread to process the songs that are loaded by the user using the OpenFileDialog. I am using the next code to start the process the songs: public static List<MediaFile> MediaList = new List<MediaFile>(); public static Queue<String> MediaFilesQueue = new Queue<String>(); public static void AddMediaFilesToMediaList() { String pathToFile; while (MediaFilesQueue.Count > 0) // all the files are loaded into the Queue before processing { pathToFile = MediaFilesQueue.Dequeue(); MediaData.MediaList.Add(new

Identify who invokes Event Handler

ε祈祈猫儿з 提交于 2019-12-02 04:44:50
I have my app with my labels written to centralize when its text was modified. To make that I invoke a method through an EventHandler. I want to use same method to each one of my labels, but I don´t know how to identify in the method which label invoke it. If I have a code like this: lbl_TextChanged(object sender, EventArgs e) { ..code.. label1.Location = new Point("label's location"); ..more code.. } and I invoke again that method from another label, how could I modify that code in order to know which label invoke it? SOLUTION Thanks for the help, This is the first time I tried to make

Method name expected c#

梦想的初衷 提交于 2019-12-02 04:20:57
I have an event handler, i would like to pass some parameters to the event like this, that line trigger an error: method name expected p.Click += new System.EventHandler(P_Click(sender, new MyEventArgs { design = reader1["desig_prd"].ToString(), prix = (float)reader1["prix_prd"] })); my P_Click event public void P_Click(Object sender, EventArgs e) { var args = (MyEventArgs)e; string deignation = args.design; MessageBox.Show(deignation); } and i have class MyEventArgs like this class MyEventArgs : EventArgs { public string design { get; set; } public float prix { get; set; } } Any help? Thanks

asp:Button Click event not being fired

五迷三道 提交于 2019-12-02 04:16:53
问题 I am dynamically adding rows in an asp table. In each row of the table I am also including a button which has a SelectProduct_Click event. The problem is that even though I am registering the click event, the event is not being fired. The button is being added in this way: btnSelect = new Button(); btnSelect.ID = "btnSelect"; btnSelect.CommandArgument = od.ProductId; btnSelect.Click += new EventHandler(this.SelectProduct_Click); btnSelect.CssClass = "button"; btnSelect.Text = "Select"; cell =