event-handling

Subscribing to an event of a ascx of another ascx in a different window

岁酱吖の 提交于 2019-12-11 23:50:45
问题 I'm trying to subscribe to the the save button event of a user control that is launched in a separate radwindow from the calling parent. but I am getting object not initialized error, I know why but what am I missing? Update: I found my error but it appears that if (this.SaveEvent!= null) in the ControlBase is always null Parent Control Code: public partial class myControl : ControlBase { private myChildControl __myChildControl; private void myControl_PreRender(object sender, EventArgs e) { /

Checking the visibility of a ContextMenu when associated with a NotifyIcon

无人久伴 提交于 2019-12-11 22:57:18
问题 According to this answer on another question, the Collapsed event of a ContextMenu is only raised if it's associated to a control before calling Show() . SInce a NotifyIcon does not count as a control, I can't hook onto the Collapsed event to detect when the menu associated to one is hidden. Are there any workarounds? 回答1: Under the "Remarks" section for the MSDN docs on TrackPopupMenuEx, it says: To display a context menu for a notification icon, the current window must be the foreground

Jquery Event handler not working when calling from page

五迷三道 提交于 2019-12-11 22:19:57
问题 I have written an event to save the data in a widget.js file & the handler is on the page. There is no error or exception is coming but the handler is not getting called. Please help. Widget.js : (function ($, undefined) { $.widget('ui.discussionwidget', { options: { userID: 'arti.agarwa', title: "", width: "", containerClass: ".ui-content-gutter" }, saveData: function (userName, msg, parentID) { //Save Discussion History $.event.trigger({ type: "sendMessage", userName: userName, message: msg

Prevent ImageView from receiving touch events when scrolling

ぐ巨炮叔叔 提交于 2019-12-11 22:12:15
问题 I'm making an app with lots of ImageView s and I needed to attach a touch listener in some of them. While doing this, I encountered a problem. If the pointer was held down at the location where the ImageView with touch listeners attached to it and was about to produce a scrolling event, there seems a fighting scene between the View s and the ScrollView in w/c where the event was actually occured and in w/c the event is supposed to belong. The screen scrolls in a fast rate then return where

Define dynamically event handler in Java

半世苍凉 提交于 2019-12-11 21:33:40
问题 Assume that I have defined two arrays in Java. The first array has m cells and the second has n cells. Assume that each cells can have a 0 or 1 value. In this program every cell of the first array will join one of the cells of the second array, but we do not know which one will be connected to which cell of the second array (This connection is totally logical,e.g. we just know array1[3] is related to array2[7] ). So now I want to define an event handler for each of these relationship, so when

PostMessage(), SendMessage not working in ATL dll (event handling)

百般思念 提交于 2019-12-11 20:43:52
问题 sorry, my english skill is very low. i make a ATL(C++) dll. and handled by VB. i make under base code. WaitAndReadData, Thread_WaitAndReadData is working. but, ::SendMessage, ::PostMessage is not working in Thread_WaitAndReadData or WaitAndReadData. and breakpoint not working in Get_Data_Messagehandler. (+ another function call.) #define WM_SERVERTHREADFIREEVENT (WM_USER+2) BEGIN_MSG_MAP(CHello) CHAIN_MSG_MAP(CComControl<CHello>) MESSAGE_HANDLER(WM_SERVERTHREADFIREEVENT, GetData

Having issues using a scope in Jquery

冷暖自知 提交于 2019-12-11 20:32:41
问题 So I'm trying to pass a freemarker variable value (${item.uid}) on the click of a link in order to launch a modal with the same unique id value. Although my functions can access the value of uid , when I run $('body').append($('div.disclaimer' + outerVar).remove()); the outerVar shows undefined . JavaScript var outerVar = uid; $('body').append($('div.disclaimer' + outerVar).remove()); function showDisclaimer(uid) { var x = uid; $('div.disclaimer' + x).show(); } function closeDisclaimer(uid) {

onmousedown over-rides onmouseup and onclick

北慕城南 提交于 2019-12-11 20:02:29
问题 Consider the following demo code: <p id="demo" style="border: 1px solid black;width:300px;height:300px"></p> <script> document.getElementById("demo").onmousedown = function(e){ alert('mousedown'); } document.getElementById("demo").onmouseup = function(e){ alert('mouseup'); } document.getElementById("demo").onclick = function(e){ alert('click'); } </script> Can someone please explain to me why neither the mouseup nor click events get fired? 回答1: When you press your mouse button down, you are

How to use the DropDownList's SelectedIndexChanged event

佐手、 提交于 2019-12-11 20:00:19
问题 I have two DropDownList s in my webform and when I select a value in the first dropdownlist, I would like a related value to be automatically selected in the second dropdownlist. This is what I currently have: <table> <tr> <td> <asp:Label ID="lbmanu" runat="server" Text="Furniture Manufacturer : "></asp:Label> </td> <td> <asp:DropDownList ID="ddmanu" runat="server" DataSourceID="Sql_fur_model_manu" DataTextField="manufacturer" DataValueField="manufacturer" onselectedindexchanged="ddmanu

VB.NET: WithEvents not Working

為{幸葍}努か 提交于 2019-12-11 19:38:39
问题 I have the following classes: Public Class Email Private Shared ReadOnly EMAIL_REGEX = "\b[a-zA-Z]+[a-zA-Z0-9._+-]+@" + _ "[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}\b" Private _email As String Public Event emailCreated() ' Declare empty constructor private so the only way to create an object ' is using new (email) Private Sub New() End Sub Sub New(ByVal email As String) If Regex.IsMatch(email, EMAIL_REGEX) Then _email = email RaiseEvent emailCreated() Else Throw New Exception("Email Not Valid") End If