Search Results

Search found 19541 results on 782 pages for 'event handling'.

Page 188/782 | < Previous Page | 184 185 186 187 188 189 190 191 192 193 194 195  | Next Page >

  • How to intercept an Exit event for a Windows Form in VB?

    - by Dooms101
    When a user clicks on the little red "x" a.k.a. the form close button on the form command bar, what even is activated besides FormClosed() I know FormClosing() is called, but I cannot really stop the form from closing after my code is run. I want to be able to show a messagebox that asks if the user wants to exit the form or not. Obviously if they click no, I want the form to stay open, how would I do this?

    Read the article

  • Is there a comprehensive list of the NHibernate event listeners and when they actually fire?

    - by snicker
    So I am looking for a nice list of NHibernate events that actually describes when they are fired, in a typical scenario. IE something like PreUpdateEventListener - Fires when an object that is already persistent is changing I currently just rifle through the source and try to figure it out, but it's kinda painful, and I figure that someone must have done this already at some point.

    Read the article

  • Using a named system semaphore as an event to trigger something in another process.

    - by jbraz
    I have a thread that runs all the time: private void DoSomeStuffThread() { Semaphore sem = new Semaphore(0, 3, "sem_DoStuff"); sem.WaitOne(); do { //do some stuff } while (sem.WaitOne()); } I want to be able to only execute the stuff in the do block when something from another process says so. I am trying to use the "sem_DoStuff" named system semaphore to allow this to happen. The code that gets executed in my other process: public string DoStuff() { try { Semaphore sem = Semaphore.OpenExisting("sem_DoStuff"); sem.Release(); } catch (Exception e) { return e.Message; } } So, the idea is that when DoStuff gets called, the semaphore gets released, and DoSomeStuffThread stops waiting, executes what is in the do block, and then waits for DoStuff again before it is getting called. But, when DoStuff gets called, I'm getting the exception 'No handle of the given name exists.'. What am I doing wrong? Thanks.

    Read the article

  • How can I get reason of page unloading in javascript's onunload event, in IE?

    - by DM
    There may be different reasons of page unloading: 1 User closes the current window. 2 User navigates to another location. 3 Clicks the Back, Forward, Refresh, or Home button. 4 User submits a form, and then browser starts to unload current page and load page with results of form submitting. (Assuming that the current window is the form's target). 5 and so on... Can I somehow know in onunload handler that the reason of unloading is p.4, i.e. moving to page with results of form submitting? I could define some flag when submiting form, but this does not solve the problem. Because response (on form submit) from web server takes some time, browser doesn't unload the current page immediately and waits response from server. And during this waiting user may close window or navigate anywhere. And I need to know whether was it indeed moving to results page or something else...?

    Read the article

  • $(document).ready(function(){ executed every time on onclick event of Hyperlink?

    - by Photon Critical Fatal Error_
    In my code I'm creating a product list dynamically using PHP(see image) and the currosponding labels and image paths are stored into hidden fields(created dynamically using PHP) now on document.ready() method i set the first list item's imagepath to img's src and its remarks to label remarks using first hidden fields for remark and imagepath. and on listitem click i want to change it my function set these values to img and label rightly(checked using alerts) but when function ends it set the image src and remarks innertext to default that is set on document.ready() method now my question is can i prevent the document.ready() to be executed next time on javascript function call My View : As the images are reloaded so the page rendering is done again so the document.ready is called again and set these values again to default. Note : My page is not reloading any time only images and labels are being changed The listshown in image is just one group other group is also created dynamically . server side code in PHP <?php for($j=0;$j<count($productstr);$j++) { $valuerem = $productstr[$j]["pcode"]; $idrem = "rem".$j.$grp; $valueimg =$productstr[$j]["imgpath"]; $idimg = "img".$j.$grp; echo "<input type='hidden' value='$valuerem' id='$idrem' />" ; echo "<input type='hidden' value='$valueimg' id='$idimg' />" ; }?> <script> $(document).ready(function() { idrv < ? PHP echo $grp; ? > = 'rem0<?PHP echo $grp; ?>'; idmv < ? PHP echo $grp; ? > = 'img0<?PHP echo $grp; ?>'; $('#txt<?PHP echo $grp; ?>').text(document.getElementById(idrv < ? PHP echo $grp; ? ).value); alert($('#txt<?PHP echo $grp; ?>').text()); $('#img<?PHP echo $grp; ?>').attr('src', document.getElementById(idmv < ? PHP echo $grp; ? > ).value); alert($('#img<?PHP echo $grp; ?>').attr('src')); }); function Change(id) { idrv < ? PHP echo $grp; ? > = 'rem' + id; idmv < ? PHP echo $grp; ? > = 'img' + id; $('#txt<?PHP echo $grp; ?>').text(document.getElementById(idrv < ? PHP echo $grp; ? > ).value); alert($('#txt<?PHP echo $grp; ?>').text()); $('#img<?PHP echo $grp; ?>').attr('src', document.getElementById(idmv < ? PHP echo $grp; ? > ).value); alert($('#img<?PHP echo $grp; ?>').attr('src')); return true; }? </script> alerts are used just to test the values the code that are being generated at client browser <tr> <td width="220px" valign="top" align="left"> <input id="YN" type="hidden" value="true"> <input id="rem00" type="hidden" value="SPL FUNNEL 1"> <input id="img00" type="hidden" value="adminpanel/product_images/4f8e530154d74155.jpg"> <input id="rem10" type="hidden" value="SPL FUNNEL 2"> <input id="img10" type="hidden" value="adminpanel/product_images/4f8e53daf13e6156.jpg"> <input id="rem20" type="hidden" value="SPL FUNNEL 3"> <input id="img20" type="hidden" value="adminpanel/product_images/4f8e543100eaf157.jpg"> <input id="rem30" type="hidden" value="SPL FUNNEL 4"> <input id="img30" type="hidden" value="adminpanel/product_images/4f8e545a829e1158.jpg"> <script> $(document).ready(function() { idrv0 = 'rem00'; idmv0 = 'img00'; $('#txt0').text(document.getElementById(idrv0).value); alert($('#txt0').text()); $('#img0').attr('src', document.getElementById(idmv0).value); alert($('#img0').attr('src')); }); function Change(id) { $('#YN').val('false'); idrv0 = 'rem' + id; idmv0 = 'img' + id; $('#txt0').text(document.getElementById(idrv0).value); alert($('#txt0').text()); $('#img0').attr('src', document.getElementById(idmv0).value); alert($('#img0').attr('src')); return true; }? </script> <ul> <li> <a id="00" style="text-decoration: none; text-size: 1.1em; color: " onclick=" Change(this.id); alert($('#txt0').text()); alert($('#img0').attr('src'));"> SPL FUNNEL 1</a> </li> <li> <li> <li> </ul> </td> <td valign="bottom" align="left" colspan="2"> <td width="110px" valign="bottom" align="left" style="width: 180px"> </tr>

    Read the article

  • using JQuery on beforeprint event problem. Not answered.

    - by Cesar Lopez
    Hi all, I have the following function. <script type="text/javascript"> window.onbeforeprint = expandAll; function expandAll(){ $(".fieldset:gt(0)").slideDown("fast"); } </script> For this html <table class="sectionHeader" ><tr ><td>Heading</td></tr></table> <div style="display:none;" class="fieldset">Content</div> I have several block of content over the page, but when I do print preview or print, I can see all divs sliding down before opening the print preview or printing but on the actual print preview or print out they are all collapse. Anyone have any idea why is this? Thanks.

    Read the article

  • how to scroll table on the click event of some cell in objective c?

    - by Sarah
    Hello friends, I am right now working with one application where i need to take one uitableview with uilable and textfield in each cell.I am able to scroll the table manually once the user starts writing, but what i want is that when i click on the textfield,the table should scroll upward so that the user is able to see what he has entered in the textfield.Same thing i saw once i logged in the iphone facebook. this is the code for manually scrolling the table : - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 250; } -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { CGRect viewRect = CGRectMake(0, 0, 320, 160); UIView *footerView = [[UIView alloc] initWithFrame:viewRect]; return footerView; } Is there any way around? Thanks in advance.

    Read the article

  • How do I programmatically trigger a mx:Button click event?

    - by knorv
    Consider the following mx:Button: <mx:Button click="doSomething()" id="myButton"/> Is there some way to programmatically emulate the user clicking the button? One obvious way to do it would simply be to call doSomething() which would give the same end result as clicking the button. But I'm specifically looking for ways to emulate the click -- that is something along the lines of myButton.click() (if that should have existed).

    Read the article

  • mfc, how can i make a proccess in an OnLButtonDown() event happen again and again untill i live the

    - by Erez
    What happen untill now is this... Any line happens once, and if i use a while(1) or while (nFlags == MK_LBUTTON) its working as it should but i get a crash... The other problem, or mabye the same one is the delay if i will be able to do it, mabye using while() with Timer()????? I was thinking about Timer() to recall the function with delay but i can't call OnLButtonDown() becouse as i understand it only a messege can call it with the arguments..... 10x

    Read the article

  • Custom events and event pooling in jQuery - What's the point?

    - by Nick Lowman
    I've been reading about custom events in jQuery and why they should be used but I'm still clearly missing the point. There is a very good article I read here that has the following code example; function UpdateOutput() { var name = $('#txtName').val(); var address = $('#txtAddress').val(); var city = $('#txtCity').val(); $('#output').html(name + ' ' + address + ' ' + city); } $(document).bind('NAME_CHANGE ADDRESS_CHANGE CITY_CHANGE', function() { UpdateOutput(); }); $('#txtAddress').keyup(function() { $(document).trigger('ADDRESS_CHANGE'); }); $('#txtCity').keyup(function() { $(document).trigger('CITY_CHANGE'); }); Can someone tell me why I just don't call the UpdateOutput() function directly? It would still work exactly the same way, i.e. $('#txtAddress').keyup(function() { UpdateOutput() }); $('#txtCity').keyup(function() { UpdateOutput() }); Many thanks

    Read the article

  • Can I close the jquery datePicker pop up window on click event?

    - by kumar
    I have datepicker code is this.. $("input[id^='exc-flwup-']").datepicker({ duration: 0, constrainInput: true, showTime: true, stepMinutes: 30, stepHours: 1, altTimeField: '', time24h: true, minDate: 0 }); Input field is <label for="FollowupDate"> Follow-up: <input type="text" id="exc-flwup-<%=Model.ExceptionID %>" name="exc-flwup-<%=Model.ExceptionID %>" value="<%=Model.FollowupDate %>" /> </label> First click on input box I am getting popup window I can select the date.. but when I am trying to clear the date from Inputbox.. when I click on the input box again is tehre any way that we canclose the popupwindow? thanks

    Read the article

  • IE6 forces Two clicks to trigger javascript style=display:inline; event

    - by JiminyCricket
    I have a web form that has 2 radio buttons, depending on which one is clicked it displays a hidden element This works fine in all browsers except for IE6, which, after I click on the radio button, I have to click again (anywhere on the window) and then the element is displayed...has anyone had behavior like this before? I tried to not use jQuery and do straight getElementById() but I get the same behavior... JSCRiPT function showHidden(divid) { $('#'+divid).css( {'display':'inline'} ); } HTML <input type=radio name=borp value=1 onChange='showHidden("brandchecks")' > Brand <input type=radio name=borp value=2 onChange='showHidden("productchecks")' > Product <div id='brandchecks' style='display:none;'> Blah </div> <div id='productchecks' style='display:none;'> Blah </div>

    Read the article

  • Android ImageButton not firing the onclick event, what is wrong with my code?

    - by kimo
    I have very simple code that includes ImageButton with OnClickListener that points to another Activity, the click on the ImageButton doesn't fire the onClick (The same problem was with Button) : public class ToolsActivity extends Activity { private ImageButton btnCamera; final Context context = ToolsActivity.this; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tools); this.btnCamera = (ImageButton) findViewById(R.id.cameraButton); this.btnCamera.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(context,MainActivity.class); startActivity(intent); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_tools, menu); return true; } XML: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingLeft="16dp" android:paddingRight="16dp" > <ImageButton android:id="@+id/cameraButton" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:background="@drawable/btncamera" android:contentDescription="@string/desc" />

    Read the article

  • How to combine two rows and calculate the time difference between two timestamp values in MySQL?

    - by Nadar
    I have a situation that I'm sure is quite common and it's really bothering me that I can't figure out how to do it or what to search for to find a relevant example/solution. I'm relatively new to MySQL (have been using MSSQL and PostgreSQL earlier) and every approach I can think of is blocked by some feature lacking in MySQL. I have a "log" table that simply lists many different events with their timestamp (stored as datetime type). There's lots of data and columns in the table not relevant to this problem, so lets say we have a simple table like this: CREATE TABLE log ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(16), ts DATETIME NOT NULL, eventtype VARCHAR(25), PRIMARY KEY (id) ) Let's say that some rows have an eventtype = 'start' and others have an eventtype = 'stop'. What I want to do is to somehow couple each "startrow" with each "stoprow" and find the time difference between the two (and then sum the durations per each name, but that's not where the problem lies). Each "start" event should have a corresponding "stop" event occuring at some stage later then the "start" event, but because of problems/bugs/crashed with the data collector it could be that some are missing. In that case I would like to disregard the event without a "partner". That means that given the data: foo, 2010-06-10 19:45, start foo, 2010-06-10 19:47, start foo, 2010-06-10 20:13, stop ..I would like to just disregard the 19:45 start event and not just get two result rows both using the 20:13 stop event as the stop time. I've tried to join the table with itself in different ways, but the key problems for me seems to be to find a way to correctly identify the corresponding "stop" event to the "start" event for the given "name". The problem is exactly the same as you would have if you had table with employees stamping in and out of work and wanted to find out how much they actually were at work. I'm sure there must be well known solutions to this, but I can't seem to find them...

    Read the article

  • How to add on to an existing onclick event?

    - by Corey Sarnia
    I'm currently writing a Greasemonkey script for a page, so I can't modify the script myself. There is a form submit button on the page. When you click this button, it executes some fancy AJAX calls and such to update the page and do serverside things. What I'm trying to is basically set a "lastClick" value when the button is clicked. I want to add the code GM_setValue("lastClicked", (new Date()).getTime().toString()) to store the last time the button was clicked (for future uses of the script, it will actually do something with this date). How exactly can I accomplish this?

    Read the article

  • How do I attach event bindings to items on a canvas using Tkinter?

    - by Ian
    If I'm using a canvas to display data and I want the user to be able to click on various items on the canvas in order to get more information or interact with it in some way, whats the best way of going about this? Searching online I can find information about how to bind events to tags but that seems to be more indirect then what I want. I don't want to group items with tags, but rather have specific function calls when the user clicks specific items on the canvas.

    Read the article

  • How to implement event listener in background of the main program in java?

    - by Johny
    Hi im a beginner so sorry for my question if it sounds naive. I want to implement a thread that runs in the background and listens all the time. By listening i mean, say it keeps check on a value returned from main thread and if the vaue exceeds certain figure, it executes some method, or say exits the program. If you could give me some idea or at least refer me to something useful, that'll be great.

    Read the article

  • Trouble managing events in Flex/actionscript

    - by Zaka
    Hello all, I'm doing some newbie tests, so I decided to capture the keyboard events to move a rectangle. But I don't get the desired result. Unless I click on the TextArea box, I'm not able to capture the event key code. After that, all goes pretty well. I'm using Eclipse 3.3 + Flex 3.0 on Linux. Here's my code: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" enterFrame="enterFrame(event)" keyDown="onKeyDown(event)"> <mx:TextArea id="myText" x="200" y="200" width="100" height="100" /> <mx:Canvas id="myCanvas" x="0" y="0" width="100" height="100" /> <mx:Script> <![CDATA[ public var clearColor : uint = 0xFF456798; public var myPoint : Point = new Point(0,0); public function enterFrame(event:Event):void { myCanvas.graphics.clear(); myCanvas.graphics.beginFill(0xFF344ff0); myCanvas.graphics.drawRect(myPoint.x,myPoint.y,40,40); myCanvas.graphics.endFill(); } public function onKeyDown(event:KeyboardEvent):void { myText.text = "Keycode is: " + event.keyCode + "\n"; switch(event.keyCode) { case 37: //Left myPoint.x -= 1; break; case 38: //Up myPoint.y -= 1; break; case 39: //Right myPoint.x += 1; break; case 40: //Down myPoint.y += 1; break; } } ]]> </mx:Script> </mx:Application>

    Read the article

  • How to control the state of the buttons to be in present based on an event happened in a Silverlight app?

    - by vladc77
    I am trying to avoid building two buttons when I really need one. In my Silverlight app scenarios, I have few grids with a different content and buttons that control the visibility of these grids. I need to be able to show a different visual for a button when its content grid is visible. I can control states such as MouseOver and Pressed and more with visual state manage. However, I am not sure how to achieve this functionality with. I also can place an image on top of the button and switch the visibility of both but it is not perfect for what I need. I am wondering if there is any way to achieve this behavior. Any ideas are highly appreciated!

    Read the article

  • How to check that this event would occur after DOM is ready in jquery ?

    - by Rachel
    I want to get page_tag information from the page and want to make sure that DOM for this page is already ready before getting the page tag information. I am doing $(document).ready( { alert("test"); var page_tag : $("head meta[name='page_tag']").attr('content'); page_tag : (page_tag) ? page_tag : ''; } But it gives me errors, missing : after property id alert("Check if document is ready");\n Any suggestions on what could be the possible reasons for it or any other way of checking if the dom is ready or not before getting page_tag information.

    Read the article

< Previous Page | 184 185 186 187 188 189 190 191 192 193 194 195  | Next Page >