Search Results

Search found 10381 results on 416 pages for 'delegate and events'.

Page 86/416 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • WPF: Asynchronous progress bar

    - by SumGuy
    I'm trying to create a progress bar that will work asynchronously to the main process. I'm created a new event and invoked it however everytime I then try to perform operations on the progress bar I recieve the following error: "The calling thread cannot access this object because a different thread owns it" The following code is an attempt to send an instance of the progress bar to the event as an object, it obviously failed but it gives you an idea of what the code looks like. private event EventHandler importing; void MdbDataImport_importing(object sender, EventArgs e) { ProgressBar pb = (ProgressBar)sender; while (true) { if (pb.Value >= 200) pb.Value = 0; pb.Value += 10; } } private void btnImport_Click(object sender, RoutedEventArgs e) { importing += new EventHandler(MdbDataImport_importing); IAsyncResult aResult = null; aResult = importing.BeginInvoke(pbDataImport, null, null, null); importing.EndInvoke(aResult); } Does anyone have ideas of how to do this. Thanks in advance SumGuy.

    Read the article

  • Creating a Cross-Process EventWaitHandle c#

    - by Navaneeth
    Hello all, I have two windows application, one is a windows service which create EventWaitHandle and wait for it .Second application is a windows gui which open it by calling EventWaitHandle.OpenExisting() and try to Set the event .But I am getting an exception in OpenExisting .The Exception is "Access to the path is denied". windows Service code EventWaitHandle wh = new EventWaitHandle(false, EventResetMode.AutoReset, "MyEventName"); wh.WaitOne(); Windows GUI code try { EventWaitHandle wh = EventWaitHandle.OpenExisting("MyEventName"); wh.Set(); } catch (Exception ex) { MessageBox.Show(ex.Message); } I tried the same code with two sample console application ,it was working fine. Looking forward to hearing from you

    Read the article

  • jQuery AutoComplete select firing after change?

    - by Zarigani
    I'm using the jQuery UI AutoComplete control (just updated to jQuery UI 1.8.1). Whenever the user leaves the text box, I want to set the contents of the text box to a known-good value and set a hidden ID field for the value that was selected. Additionally, I want the page to post back when the contents of the text box are changed. Currently, I am implementing this by having the autocomplete select event set the hidden id and then a change event on the text box which sets the textbox value and, if necessary, causes a post back. If the user just uses the keyboard, this works perfectly. You can type, use the up and down arrows to select a value and then tab to exit. The select event fires, the id is set and then the change event fires and the page posts back. If the user starts typing and then uses the mouse to pick from the autocomplete options though, the change event fires (as focus shifts to the autocomplete menu?) and the page posts back before the select event has a chance to set the ID. Is there a way to get the change event to not fire until after the select event, even when a mouse is used? $(function() { var txtAutoComp_cache = {}; var txtAutoComp_current = { label: $('#txtAutoComp').val(), id: $('#hiddenAutoComp_ID').val() }; $('#txtAutoComp').change(function() { if (this.value == '') { txtAutoComp_current = null; } if (txtAutoComp_current) { this.value = txtAutoComp_current.label ? txtAutoComp_current.label : txtAutoComp_current; $('#hiddenAutoComp_ID').val(txtAutoComp_current.id ? txtAutoComp_current.id : txtAutoComp_current); } else { this.value = ''; $('#hiddenAutoComp_ID').val(''); } // Postback goes here }); $('#txtAutoComp').autocomplete({ source: function(request, response) { var jsonReq = '{ "prefixText": "' + request.term.replace('\\', '\\\\').replace('"', '\\"') + '", "count": 0 }'; if (txtAutoComp_cache.req == jsonReq && txtAutoComp_cache.content) { response(txtAutoComp_cache.content); return; } $.ajax({ url: 'ajaxLookup.asmx/CatLookup', contentType: 'application/json; charset=utf-8', dataType: 'json', data: jsonReq, type: 'POST', success: function(data) { txtAutoComp_cache.req = jsonReq; txtAutoComp_cache.content = data.d; response(data.d); if (data.d && data.d[0]) { txtAutoComp_current = data.d[0]; } } }); }, select: function(event, ui) { if (ui.item) { txtAutoComp_current = ui.item; } $('#hiddenAutoComp_ID').val(ui.item ? ui.item.id : ''); } }); });

    Read the article

  • Is there a Windows equivalent for eventfd?

    - by Leaurus
    I am writing a cross-platform library which emulates sockets behaviour, having additional functionality in the between (App-mylib-sockets). I want it to be the most transparent possible for the programmer, so primitives like select and poll must work with accordingly with this lib. The problem is when data becomes available (for instance) in the real socket, it will have to go through a lot of processing, so if select points to the real socket fd, app will be blocked a lot of time. I want the select/poll to unblock only when data is ready to be consumed (after my lib has done all the processing). So I came across this eventfd which allows me to do exactly what I want, i.e. to manipule select/poll behaviour on a given fd. Since I am much more familiarized with Linux environment, I don't know what is the windows equivalent of eventfd. Tried to search but got no luck. Anyone can help me, please?

    Read the article

  • Raise event to another control with jquery

    - by Chad
    Is it possible to raise a keyup event from one control (text input) to another control (say, a select element)? In short, when certain keys are pressed in the text box (up, down, etc) I need that event to also happen in the select element.

    Read the article

  • javascript csv validation

    - by Hulk
    How to check for comma separated values in a text box and raise an alert if not found. And there is should be characters in it like A,B,C,D function validate() { //validate text box; } <input type="text" id="val" >A,B,C,D</input> <input type="button" id="save" onclick="validate()"> Thanks.

    Read the article

  • "KeyPress" event for WinForms textbox is missing?

    - by eibhrum
    I am trying to add an "KeyPress" event in a textbox (WinForm) this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(CheckKeys); and here's inside the 'CheckKeys': private void CheckKeys(object sender, System.Windows.Forms.KeyPressEventArgs e) { if (e.KeyChar == (char)13) { // Enter is pressed - do something } } The idea here is that once a textbox is in focus and the 'Enter' button was pressed, something will happen... However, my machine cannot find the 'KeyPress' event. Is there something wrong with my codes? UPDATE: I also tried putting KeyDown instead of KeyPress: private void textBox1_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == Key.Return) // Enter is pressed - do something } } Still not working though...

    Read the article

  • Blackberry Menu from native blackberry application

    - by chrishawn
    I have an application that inserts an ApplicationMenuItem into the native blackberry contacts menu. I can get this to work just fine. Now my question is how would I change or remove that ApplicationMenuItem based on the contact that i am highlighted on? Would I need to use a GlobalEventListener? I assume overriding makeMenu can only be done for menus on my own screens and not the native contacts screen?

    Read the article

  • HTML 5 Video OnEnded Event not Firing

    - by Eric J.
    I'm trying to react to the HTML 5 onended event for the video tag without success. In the code snippet below I added the mouseleave event to be sure the jQuery code is correct and that event does activate the alert() box. The video plays just fine but onended does not cause my alert() to fire off. Testing in Chrome, updated today to version 5.0.375.55. <html> <head> <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script> $(document).ready(function(){ $("#myVideoTag").bind('mouseleave onended', function(){ alert("All done, function!"); }); }); </script> </head> <body> <video id="myVideoTag" width="640" height="360" poster="Fractal-zoom-1-04-Snowflake.jpg" controls> <source src="Fractal-zoom-1-04-Snowflake.mp4" type="video/mp4"></source> <source src="Fractal-zoom-1-04-Snowflake.ogg" type="video/ogg"></source> </video> <body> <html>

    Read the article

  • Google Maps v3, custom control with textbox: can't perform input

    - by Mike Sviridoff
    Hi, I am trying to add a custom control to my google map (v3): want to have search box just near the other map controls. So I add a div with <input type="textbox"> on it, and it's being shown on the map. But the porblem is that the textbox is inaccessible: i can't type anything inside it, or even focus on it. function SearchBox() { var searchTextBox = $('<input type="text" id="txtGeoSearch" />'); var div = $('<div class="geoSearchBox"></div>') .append($('<span>Search:</span>')) .append(searchTextBox); return div.get(0); } // inside init() geoMap.controls[google.maps.ControlPosition.TOP_LEFT].push(new SearchBox()); So what should I do to make my textbox behave like normal one?

    Read the article

  • call the id in javascript

    - by user295189
    I have a span like this <span id="selectedTests" class="emrFG"> <span id="lblSelectedTests" class="emrHDR" style="top:3;left:6;font-size:8pt;">Selections</span> <span class="emrHDR" style="top:3;left:190;font-size:8pt;">Tests</span> <div id="recordSet" style="top:19;height:112;width:444;"></div> </span> The span shows some rows of data and I want to call those rows individually by using document.all method. How would I do that?

    Read the article

  • Find the item index in jCarouselLite

    - by stanley
    Hi all, I use jCarouselLite for scrolling text, I use and as the content for scrolling, I need to trigger a javascript event when it reaches at the end of the content(). I need to change the scroll content when it finishes scrolling previous content. I tried adding a call back function but it does'nt work. This is my code: $("#scrollDiv").jCarouselLite({ vertical: true, visible:3, hoverPause:true, scroll:3, auto:1, itemLastInCallback:changeItem, speed:5000 }); Certification Alerts-CertifyAssign cert_test_11 - cert_test_22_sub - sub_test_22 cert_adhoc - cert_adhoc_11 - stype1 Certification Alerts-CertifyReminder sales process001 - sub sales cert 2 - sales cert

    Read the article

  • Calling notifyDataSetChanged doesn't fire onContentChanged event of SimpleCursorAdapter

    - by Pentium10
    I have this scenario onResume of an activity: @Override protected void onResume() { if (adapter1!=null) adapter1.notifyDataSetChanged(); if (adapter2!=null) adapter2.notifyDataSetChanged(); if (adapter3!=null) adapter3.notifyDataSetChanged(); super.onResume(); } Adapter has been defined as: public class ListCursorAdapter extends SimpleCursorAdapter { Cursor c; /* (non-Javadoc) * @see android.widget.CursorAdapter#onContentChanged() */ @Override protected void onContentChanged() { // this is not called if (c!=null) c.requery(); super.onContentChanged(); } } And the onContentChanged event is not fired, although the onResume and the call to the adapter is issued. What is wrong?

    Read the article

  • Detect Click into Iframe using JavaScript

    - by Russ Bradberry
    I understand that it is not possible to tell what the user is doing inside an iframe if it is cross domain. What I would like to do is track if the user clicked at all in the iframe. I imagine a scenario where there is an invisible div on top of the iframe and the the div will just then pass the click event to the iframe. Is something like this possible? If it is, then how would I go about it? The iframes are ads, so I have no control over the tags that are used.

    Read the article

  • Disable the asp button on click of the same button till the process ends

    - by Rupa
    Hi, I need help in the following scenario: On click of a SAVE button in aspx page,some processing will take place. The processing can be of 10-15 minutes.I want to disable the SAVE button till process ends and once process completes, the SAVE button should be enabled. I tried the following but couldnot solve the problem: 1)Client Side Scripting: I called a java script on client clik of button and set the disable property to true.How ever, server side saveButton_Click event is not called because of disabling the button on client side. 2)Disabling in saveButton_Click method on server side: In this case, as the call of saveButton_Click already happend and requested is sent to server,the client side is as it without any difference until the request is processed. Please help me in this asap. Its very URGENT. Thanks Rupa

    Read the article

  • Textbox OnTextChanged and Button Click Event Not Firing

    - by goodwince
    I have textboxes being generated by a repeater that use OnTextChanged with autopostback enabled so that I can know when when the values change. This all works perfect. The problem starts when I try to click on any buttons on the page. The loss of focus triggers the event for the OnTextChanged; however, the event for my buttons never get fired. I checked this in the debugger and while debugging if I put a break-point in the page_load it will call both; however, without the break-point it still only calls the OnTextChanged event. I found this post on JavaScript. If my problem is also JavaScript related, why does the clicking of the button fire in debug mode? Thanks.

    Read the article

  • jQuery onkeyup event in textarea that does not fires when nothing change.

    - by Kucebe
    I was thinking to a function that check the key value pressed, and accept only the most common characters, canc, enter, ... because i need it only for basic ascii character set (not ñ, c, chinese chars, ...). Or function that after every keyup checks if value has changed. But really jQuery doesn't have an event handler for this situation? Oh, it should be cross-borwser.

    Read the article

  • window.focus() not working in Google Chrome

    - by nickyt
    Hey folks, Just wondering if Google Chrome is going to support window.focus() at some point. When I mean support, I mean have it work. The call to it doesn't fail, it just doesn't do anything. All other major browsers do not have this problem: FireFox, IE6-IE8 and Safari. I have a client-side class for managing browser windows. When I first create a window the window comes into focus, but subsequent attempts to bring focus to the window do not work. From what I can tell, this appears to be a security feature to avoid annoying pop-ups and it does not appear to be a WebKit issue as it works in Safari. I know one idea someone brought forward was to close the window then reopen it, but this is a horrible solution. Googling shows that I do not appear to be the only person frustrated with this. And just to be 100% clear, I mean new windows, not tabs (tabs cannot be focused from what I've read) and all the windows being opened are in the same domain. Any ideas? MyCompany = { UI: {} }; // Put this here if you want to test the code. I create these namespaces elsewhere in code. MyCompany.UI.Window = new function() { // Private fields var that = this; var windowHandles = {}; // Public Members this.windowExists = function(windowTarget) { return windowTarget && windowHandles[windowTarget] && !windowHandles[windowTarget].closed; } this.open = function(url, windowTarget, windowProperties) { // See if we have a window handle and if it's closed or not. if (that.windowExists(windowTarget)) { // We still have our window object so let's check if the URLs is the same as the one we're trying to load. var currentLocation = windowHandles[windowTarget].location; if ( ( /^http(?:s?):/.test(url) && currentLocation.href !== url ) || ( // This check is required because the URL might be the same, but absolute, // e.g. /Default.aspx ... instead of http://localhost/Default.aspx ... !/^http(?:s?):/.test(url) && (currentLocation.pathname + currentLocation.search + currentLocation.hash) !== url ) ) { // Not the same URL, so load the new one. windowHandles[windowTarget].location = url; } // Give focus to the window. This works in IE 6/7/8, FireFox, Safari but not Chrome. // Well in Chrome it works the first time, but subsequent focus attempts fail,. I believe this is a security feature in Chrome to avoid annoying popups. windowHandles[windowTarget].focus(); } else { // Need to do this so that tabbed browsers (pretty much all browsers except IE6) actually open a new window // as opposed to a tab. By specifying at least one window property, we're guaranteed to have a new window created instead // of a tab. windowProperties = windowProperties || 'menubar=yes,location=yes,width=700, height=400, scrollbars=yes, resizable= yes'; windowTarget = windowTarget || "_blank"; // Create a new window. var windowHandle = windowProperties ? window.open(url, windowTarget, windowProperties) : window.open(url, windowTarget); if (null === windowHandle) { alert("You have a popup blocker enabled. Please allow popups for " + location.protocol + "//" + location.host); } else { if ("_blank" !== windowTarget) { // Store the window handle for reuse if a handle was specified. windowHandles[windowTarget] = windowHandle; windowHandles[windowTarget].focus(); } } } } }

    Read the article

  • JSF invoke backing bean method and reRender components on ENTER key

    - by Markos Fragkakis
    Hi, I have a datatable with as search fields. I want a method on the backing bean to be invoked when ENTER key is pressed, as well as the DataTable to be re-rendered. My approach so far only works in IE 6, and 7, not in FF. This is the inputText: <h:inputText value="#{applicantProductListBean.applicantNameFilterValue}" id="applicantNameFilterValue" onkeypress="submitByEnter(event)"> </h:inputText> and this is the Javascript method I am invoking: function submitByEnter(e){ if(e.keyCode==13){ // alert("Enter was pressed"); e.returnValue=false; e.cancel=true; document.getElementById("applicantProductListForm:refreshButton").click(); } } As you can see, the Javascript method clicks on the button refresh, which exists on the page: <a4j:commandButton value="Refresh" id="refreshButton" action="#{applicantProductListBean.refreshData}" image="/images/icons/refresh48x48.gif" reRender="table, scroller"> </a4j:commandButton> The refreshData method does not return anything. As said before, this only works in IE 6 and IE 7. Does anyone know why it does not work in FF? An alternative I was considering was HotKey, which can indeed catch the event of ENTER, but it can only invoke Javascript, so it isn't appropriate. Is the proper way to do this via RichFaces or plain JSF? Cheers! UPDATE: Slightly modified the answer by BalusC, the script that works is: if (event.preventDefault) { // Firefox event.preventDefault(); } else { // IE event.returnValue = false; }

    Read the article

  • How do I convert some ugly inline javascript into a function?

    - by Taylor
    I've got a form with various inputs that by default have no value. When a user changes one or more of the inputs all values including the blank ones are used in the URL GET string when submitted. So to clean it up I've got some javascript that removes the inputs before submission. It works well enough but I was wondering how to put this in a js function or tidy it up. Seems a bit messy to have it all clumped in to an onclick. Plus i'm going to be adding more so there will be quite a few. Here's the relevant code. There are 3 seperate lines for 3 seperate inputs. The first part of the line has a value that refers to the inputs ID ("mf","cf","bf","pf") and the second part of the line refers to the parent div ("dmf","dcf", etc). The first part is an example of the input structure... echo "<div id='dmf'><select id='mf' name='mFilter'>"; This part is the submit and js... echo "<input type='submit' value='Apply' onclick='javascript: if (document.getElementById(\"mf\").value==\"\") { document.getElementById(\"dmf\").innerHTML=\"\"; } if (document.getElementById(\"cf\").value==\"\") { document.getElementById(\"dcf\").innerHTML=\"\"; } if (document.getElementById(\"bf\").value==\"\") { document.getElementById(\"dbf\").innerHTML=\"\"; } if (document.getElementById(\"pf\").value==\"\") { document.getElementById(\"dpf\").innerHTML=\"\"; } ' />"; I have pretty much zero javascript knowledge so help turning this in to a neater function or similar would be much appreciated.

    Read the article

  • How to attach an event to IHTMLDocument2 link elements in Delphi?

    - by Sebastian
    I'm using this code to get all the links from an IHTMLDocument2: procedure DoDocumentComplete(const pDisp: IDispatch; var URL: OleVariant); var Document:IHTMLDocument2; Body:IHTMLElement; Links:IHTMLElementCollection; i:integer; tmp:IHTMLElement; begin try Document := (pDisp as IWebbrowser2).Document AS IHTMLDocument2; Body := Document.body; Links := Document.links; for i := 0 to (Links.length-1) do begin tmp := (Links.item(i, 0) as IHTMLElement); //tmp.onclick := HOW SHOULD I ADD THE CALLBACK HERE? //ShowMessage(tmp.innerText); end; except on E : Exception do ShowMessage(E.ClassName+' error raised, with message : '+E.Message); end; end; How could I attach a function/procedure to .onclick to do a simple task like show an alert with the anchor text when the link is clicked?

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >