Search Results

Search found 2102 results on 85 pages for 'fire'.

Page 9/85 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How do I get a ComboBox SelectionChanged event to fire from a nested ListBoxItem?

    - by Stephen McCusker
    This is a rather complex problem that has me really confused right now. Any help would be greatly appreciated. The Setup: ListBox of Type A UserControls -ListBoxItem of Type A UserControl --ListBox of Type B UserControls ---ListBoxItem of Type B UserControl ----ListBox of Type C UserControls -----ListBoxItem of Type C UserControl (contains the ComboBox) In other words, the Type A control has a ListBox of Type B controls that has a ListBox of Type C controls. All of the controls are hierarchical in nature. Type A contains the data that's needed to load the Type B controls and the Type B contains the data that's needed to load the Type C controls. The Type C control has a standard ComboBox in it for changing the values of the present items. In addition to the above structure, I have drag and dropping tied to the PreviewMouseLeftButtonDown event on both the Type A and Type B UserControl levels to handle reordering/deleting/etc commands in the GUI. All of this is working as intended. The Problem: When I attempt to change the value in the ComboBox, the SelectionChanged event never fires on the Type C "level" unless I'm careful enough to click on the borders/spacing in between any Type A or B controls. This happens when my ComboBox popout menu overlaps on either a Type A or B control located below itself. The selection events for Type A or B are firing instead of the Type C events, so the ComboBox is never changing its value reliably. In the debugger, the code for handling the drag and drop is triggering on the next ListBoxItem that's located underneath the ComboBox. Thoughts: Is there a way I can make my ComboBox popup take prevalence over the items behind it while double-nested in a ListBox (ie, ignore anything behind it while it's open)? Is there some way to reroute the incorrectly firing SelectionChanged events down to the ComboBox that's supposed to be triggering them?

    Read the article

  • How do I "Fire and forget" a WinForms Form?

    - by Neil Barnwell
    What's a good technique to create a WinForms Form instance, display it (non-modally) but not have to keep a reference around to it? Normally, as soon as the variable goes out of scope, the form is closed: var form = new SuperDuperForm(); form.Show(); // Form has probably been closed instantly I don't want to have to keep track of instances of the form, I want it so that when the user closes the form, it is disposed. One idea I've had that I'm going to implement is a kind of controller that I use to open and display forms, that will keep track of them and monitor when they are closed via callbacks. I'm just wondering if there are any neat tricks to get away without that. Any ideas?

    Read the article

  • ASP.NET- forcing child/container events to fire before parent onload?

    - by Hans Gruber
    I'm working on a questionnaire type application in which questions are stored in a database. Therefore, I create my controls dynamically on every Page.OnLoad. This works like a charm and ViewState is persisted between postbacks because I ensure that my dynamic controls always have the same generated Control.ID. In addition to the user control that dynamically populates the questions, my questionnaire page also contains a 'Status' section (also encapsulated by a user control) which represents the status of the questionnaire (choices are 'Complete', 'Started' or 'In Progress'). If the user changes the status of questionnaire (i.e. from 'In Progress' to 'Complete'), I need to postback to the server because the contents of the dynamic portion of the questionnaire depend on the selected status. Some questions are always present regardless of status, and yet others may not be present at all for the selected status. The point is, when the status changes, I have to postback to the page and render the right set of questions. Additionally, I need to preserve any user entered values for those questions which are 'always available'. However, due to the page life cycle in ASP.NET, the 'Status' user control's OnLoad, which contains the correct status needed to load the right questions from the DB, doesn't get executed until after the 'dynamic questions' user control has already been populated (with the wrong/stale values). To get around this, I raise an event from my 'Status' user control to the main page to indicate that the Status has changed. The main page then raises an event on the 'dynamic questions' user control. Since by the time this event bubbles up, the 'dynamic questions' user control has already loaded the 'wrong' questions from the DB, it first calls Controls.Clear. It then happily uses the new status to query the database for the 'correct' questions and does a Control.Add() on each. FYI, Control.IDs are consistent across postbacks. This solution works...sorta. The correct set of questions for the selected status do get rendered; however ViewState is getting lost for those 'always available' questions. I'm guessing this is because the 'dynamic questions' user control calls Controls.Clear when responding to the status changed event. This must somehow kill the association between ViewState and my dynamic controls, even though the Control.ID are consistent. This seems like such a common requirement, I'm virtually certain there is a better, cleaner and less error prone approach to accomplish this. In case its not plain obvious, I haven't been able to grok the ASP.NET page life-cycle despite working with it for the last year. Any help is much appreciated!

    Read the article

  • jQuery: How to fire event when all asynchronous calls return?

    - by Jeremy
    I have a jQuery application that loads data from five asynchronous server calls. I do not want to display any data until all five calls return. (I plan on displaying a Loading message until that happens.) How can I detect when all five calls have returned? I considered having each callback method increment a variable (using jQuery's data() method, perhaps) and then waiting for the value to become 5. (I am not sure yet how I would listen for that event.) I do not think this is a very good solution, however. What would happen if two calls return at the same time? Is there a better way to do this?

    Read the article

  • How to fire an event in the code behind when a div's visibility changed?

    - by Vibin Jith
    As part of my web project ,I have designed a div tag like a window form as Shown in the figure.I just want to fill details in the textbox when the user clicks the edit label.The div is Invisible at first time. when the user clicks on edit label ,the form-div get fadein(visible). During this time an event should fired in the code behind. But I am not getting any events in the code behind like visisbility changed or some thing like that. Where can i get this event. Simply i want to display appropriate company name in the textbox in the div , when the user clicks the edit label in each row.

    Read the article

  • [Adobe Air] Can I catch a mouseUp event of an mx:Window that did not fire hte mouseDown?

    - by Irene
    Hi, In an AIR application, I have one mx:TileList with several images. What I need to do is let the user drag and drop one of the images on the desktop, giving a feeling of a desktop widget. Firstly I tried to implement this using dragStart etc, but in the end I think it is easier to handle mouseDown and mouseUp on the TileList. In general the whole setup works as desired. When a mouseDown is detected on the TileList, I create a transparent mx:Window containing the corresponding image, and call the startMove() on the Window to simulate a dragging behavior. If I release the mouse, the Window stops moving as desired. My problem is that now I want some visual feedback during dragging. It works while the Window is moving, however I can't find a way to stop it when the user releases the mouse. The mouseUp is not fired from the TileList, nor from the s:WindowedApplication. I also tried to add a listener to the Window itself, but still with no luck. Some code: private function onMouseDown(e:MouseEvent):void { trace ("down " + e.target); if (e.target is TileListItemRenderer) { // first create a dragWindow dragWindow.startGlow(); // then show some visual feedback dragWindow.moveWindow(e); // and start dragging } } private function onMouseUp(e:MouseEvent):void { trace("up " + e.target); dragWindow.stopGlow(); // <--------- Not called! } <mx:TileList id="photoTileList" mouseDown="onMouseDown(event)" mouseUp="onMouseUp(event)">

    Read the article

  • Jquery: How do I fire/play a sound file when I want?

    - by Sotkra
    I have some code that basically inflates a 'balloon' through 15 or so stages and then makes it pop at the 16th stage. (yes, images are changed). What I'm wondering now is if it's possible to use Jquery to play a sound file whenever I reach that 16th stage (or when whatever var reaches whatever value) - in other words...when I want. I've found several jquery sound plugins but they all create this player which I must then click for it to play the file. How do I skip that 'click' part so that the sound is just...directly/automatically played? http://www.sean-o.com/jquery/jmp3/ http://www.happyworm.com/jquery/jplayer/ All help is appreciated G.Campos

    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

  • How to set an alarm to fire properly at fixed time?

    - by Pentium10
    I have this code Calendar c = new GregorianCalendar(); c.add(Calendar.DAY_OF_YEAR, 1); c.set(Calendar.HOUR_OF_DAY, 23); c.set(Calendar.MINUTE, 22); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); // We want the alarm to go off 30 seconds from now. long firstTime = SystemClock.elapsedRealtime(); firstTime += 30*1000; long a=c.getTimeInMillis(); // Schedule the alarm! AlarmManager am = (AlarmManager)ctx.getSystemService(Context.ALARM_SERVICE); am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, c.getTimeInMillis(), 1*60*60*1000, sender); It is not executed at 23:22h What I am doing wrong? I noticed firstTime and c.getTimeInMillis() differs a lot in size and length. When I use firstTime, so when set to 30 seconds, the alarm is executed well.

    Read the article

  • ASP .NET Added Event Handlers to buttons on Page_Load. Event handlers do not fire the first click, b

    - by John
    Background: I am customizing an existing ASP .NET / C# application. It has it's own little "framework" and conventions for developers to follow when extending/customizing its functionality. I am currently extending some of it's administrative functionality, to which the framework provides a contract to enforce implementation of the GetAdministrationInterface() method, which returns System.Web.UI.Control. This method is called during the Page_Load() method of the page hosting the GUI interface. Problem: I have three buttons in my GUI, each of which have been assigned an Event Handler. My administration GUI loads up perfectly fine, but clicking any of the buttons doesn't do what I expect them to do. However, when I click them a second time, the buttons work. I placed breakpoints at the the beginning of each event handler method and stepped through my code. On the first click, none of the event handlers are triggered. On the second click, they are triggered. Any ideas? Example of Button Definition Button btn = new Button(); btn.Text = "Click Me Locked Screen"; bth.Click += new EventHandler(Btn_Click); Example of Event Handler Method Definition void Btn_Click(object sender, EventArgs e) { // Do Something }

    Read the article

  • ASP .NET Button event handlers do not fire on the first click, but on the second click after a PostB

    - by John
    Background: I am customizing an existing ASP .NET / C# application. It has it's own little "framework" and conventions for developers to follow when extending/customizing its functionality. I am currently extending some of it's administrative functionality, to which the framework provides a contract to enforce implementation of the GetAdministrationInterface() method, which returns System.Web.UI.Control. This method is called during the Page_Load() method of the page hosting the GUI interface. Problem: I have three buttons in my GUI, each of which have been assigned an Event Handler. My administration GUI loads up perfectly fine, but clicking any of the buttons doesn't do what I expect them to do. However, when I click them a second time, the buttons work. I placed breakpoints at the beginning of each event handler method and stepped through my code. On the first click, none of the event handlers were triggered. On the second click, they fired. Any ideas? Example of Button Definition (within GetAdministrationInterface) public override Control GetAdministrationInterface() { // more code... Button btn = new Button(); btn.Text = "Click Me!"; btn.Click += new EventHandler(Btn_Click); // more code... } Example of Event Handler Method Definition void Btn_Click(object sender, EventArgs e) { // Do Something } Page_Load Method that calls GetAdministrationInterface protected void Page_Load(object sender, System.EventArgs e) { if (!Page.IsAsync) { List<AdministrationInterface> interfaces = <DATABASE CALL>; foreach(AdministrationInteface ai in interfaces) { placeholderDiv.Controls.Add(ai.GetAdministrationInterface()); } } }

    Read the article

  • ASP .NET Dynamically adding EventHandlers to button on Page_Load. EventHandler's do not fire the fir

    - by John
    Background: I am customizing an existing ASP .NET / C# application. It has it's own little "framework" and conventions for developers to follow when extending/customizing its functionality. I am currently extending some of it's administrative functionality, to which the framework provides a contract to enforce implementation of the GetAdministrationInterface() method, which returns System.Web.UI.Control. This method is called during the Page_Load() method of the page hosting the GUI interface. Problem: I have three buttons in my GUI, each of which have been assigned an Event Handler. My administration GUI loads up perfectly fine, but clicking any of the buttons doesn't do what I expect them to do. However, when I click them a second time, the buttons work. I placed breakpoints at the the beginning of each event handler method and stepped through my code. On the first click, none of the event handlers are triggered. On the second click, they are triggered. Any ideas? Example of Button Definition Button btn = new Button(); btn.Text = "Click Me Locked Screen"; bth.Click += new EventHandler(Btn_Click); Example of Event Handler Method Definition void Btn_Click(object sender, EventArgs e) { // Do Something }

    Read the article

  • What is corresponding Cron expression to fire in every X seconds, where X > 60?

    - by giolekva
    I want my jobs to execute in every X seconds, there's one to one matching between job and X. Also during runtime there can be registered new jobs with their own intervals. I've tried to write cron expression for such scenarios, but in documentation there's written that value of seconds can't be more than 69. So cron expression like this: "0/63 * * * * ?" isn't valid. At first sight solution of that problem seemed to be expression like this: "0/3 0/1 * * * ?", but it means completely different thing: trigger job in every three second of every minute. Can you suggest what is the right solution (cron expression) for that? I know I could use just simple timers, but I've to use cron jobs using Quartz.

    Read the article

  • select list modified on-the-fly doesn't fire onChange() for new first element.

    - by staremperor
    In the code below, I'm using jquery 1.4.1 to modify the options in a select list when the user clicks on the list (replacing the single Old item with three New items). Selecting either New 2 or New 3 correctly fires the change() method (and show the alert), but selecting "New 1" does not. What am I missing? Thanks. <html> <head> <script type="text/javascript" src="js/jquery-1.4.1.min.js"></script> <script> $(document).ready(function() { $("#dropdown").mousedown(function() { $(this).empty(); $(this).append($("<option></option>").attr("value",100).text("New 1")); $(this).append($("<option></option>").attr("value",200).text("New 2")); $(this).append($("<option></option>").attr("value",300).text("New 3")); }); $("#dropdown").change(function() { alert($(this).val()); }); }); </script> <body> <select id="dropdown"><option value="1">Old 1</option></select>

    Read the article

  • PHP : How to insert an array into other child array by same index?

    - by airi
    i am new to array. Hope you can help me. i have 2 array. Let say: array 1 = [[50,60],[70,80]] array 2 = ["Fire", "Marine"] array 1 index : Array([0]=Array ([0]=50 [1]=60) [1]=Array ([0]=70 [1]=80)) array 2 index : Array ([0]= Fire [1]=Marine) How i can insert array 2 into array 1 like output below : Output that i want like below: array 3 = [["Fire",50,60],["Marine",70,80]] array 3 index = (Array([0]=Array ([0]=Fire [1]=50 [2]=60) [1]=Array ([0]=Marine [1]=70 [2]=80)) Thanks

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >