I have some VB6 code that instantiates a class which handles events that are being raised from a VB.NET component. The VB6 is pretty straightforward:
private m_eventHandler as new Collection
...
public sub InitSomething()
dim handler as EventHandler
set handler = new EventHandler
m_eventHandler.Add handler
...
m_engine.Star...
Hi all :)
I have a simple Image component,
I change its source dynamically on creation.
myimg.source = "http://foo/bar.jpg"
How can i know when the image is loaded and received so that i can check its width ?
Thanks
...
I really hate this error, because it can be so hard to pin point.
In this case, I have a page with a user control on it that contains a gridview. When a button is clicked to view one of the records in the gridview, a pop-up window (in the form of a modal dialog) opens allowing the user to edit the fields. Then, when the pop-up is clos...
I have a WPF application, where when a user unchecks a checkbox, the application will prompt to confirm. If the user chooses not to continue (cancel) is selected, i want to cancel the uncheck event. In another word, i want the checkbox to remain checked.
How can i do that in WPF?
Thanks in advance.
...
Hi all,
I was wondering if anyone can point me in the right direction.
I have an asp.net button with an click event (that runs some server side code).
What i'd like to do is call this event via ajax and jquery.
Is there any way to do this? If so, i would love some examples.
Thanks in advance
...
I have found that when I add new events to an existing COM/IDL interface, I sometimes run into strange issues unless they are added to the end of the interface.
For example, say I have the following interface:
interface IMyEvents
{
HRESULT FooCallback(
[in] long MyParam1,
[in] long MyParam2,
[in] long MyPara...
I've been trying a good way to memorize how to write events and eventhandlers in C# for a while. Whenever I want to refer to a tutorial on the Internet they tend to be verbose.
The question is how do I write events and eventhandlers in C#? Have you got a code example that illustrates easily how to write such?
...
I have a nested UserControl (this control is dynamicall loaded by another UserControl that is dynamically loaded by an aspx page inside a MasterPage) in which I would like to use a LinkButton and the OnCommand Event.
This button must be added to some panel, so I hooked up to the OnLoad event of the panel (it needs to be created before e...
Is it possible to cancel events in WinBinder?
I.e. I want to prohibit some characters in a EditBox (textbox) I listen on the WBC_KEYDOWN-Event for my control.
In other languages I'd return false or set the character-code (here in $lparam2) to null - but there seems to be no function/construct to do this in WinBinder.
...
Is there a way to take the current target of an event with ie 7 or 8?
With other browser (firefox, opera, chrome etc.) we can use
event.currentTarget or also we can use the 'this' kewyword to
refer the object received the event.
But in explorer we don't have currentTarget property and the 'this' refers to window object!
So how can I d...
Hi,
I am currently asking myself some questions about exception handling and eventhandlers, and i hope some of you will give me some help.
I will start to explain what i would like to achieve in my c# application:
I have a top-level method (lets call it the main method). This method calls an asynchronous method (wich is called connect...
Our workbooks are server-generated SpreadsheetML, which cannot include any VBA code. Creating native Excel files or Excel 2007 XML files is also not an option, unfortunately.
So, I have an Excel Add-In (VBA, not XLL) that each of our users installs to add some extra UDFs, etc. that our workbooks need.
This works great, but now I need t...
Hi all,
I have a custom collection that I am adding a ValidateItem event to. This ValidateItem event will be called whenever an item is added to or updated in the custom collection.
I want to allow derived classes to be able to subscribe to the event and determine their own logic for whether or not an item is "valid" and potentially pr...
I often run into a situation where I want to subscribe to an event, but I want to use a lambda to do so:
public class Observable
{
public event EventHandler SomethingHappened;
public void DoSomething()
{
// Do Something...
OnSomethingHappened();
}
}
// Somewhere else, I hook the event
observable.Somethi...
I'm new to Silverlight/XAML/C# and havn't figured out all the concepts yet. I'm using the Accordion control together with some templates, the XAML looks like this:
<layoutToolkit:Accordion x:Name="MatchesAccordion" SelectionMode="ZeroOrMore" Width="Auto" SizeChanged="MatchesAccordion_SizeChanged">
<layoutToolkit:Accordion.HeaderTemp...
I'm trying to set data in long-term storage in a GreaseMonkey script, except that GM_setValue() seems to fail silently:
$("a#linkid").click(function()
{
GM_setValue("foo", 123); // doesn't work, but does not generate error
});
GM_setValue("bar", 123); // works properly, value is set
...
Hi all,
I was wondering if anyone knew of a way to do some client side validation with jquery and then run the postback event manually for a asp.net control?
Here's a sample Master page
i.e.
<script type="text/javascript">
$(document).ready(function() {
$("#<%=lnkbtnSave.ClientID %>").click(function() {
alert("hello");
...
I have a pretty typical bookmarklet code that's working perfectly for me in all browsers.
However, when I take this code and put it in an HTML's element onClick handler, it doesn't work in IE (6, 7, or 8).
This is the code:
javascript: (
function(){
function l(i,u){
var d=document;
var s;
try{
s=d.standardCreateElement(...
When adding code to an onclick handler, are there any limitations to what can be done?
Can I have unlimited statements separated by ; ?
Can I declare variables that will live in the global scope?
Can I declare an anonymous function right in there and call it? (function(){})();?
Is there any limitation?
The reason I'm asking is that i'm...
I have a JPanel, which I would like to detect the following events
(1) When the mouse move in
(2) When the mouse move out
The (1) is quick easy. (2) is a bit tricky. Currently, I have to register event at all the components around JPanel. If the neighbor around JPanel detected a mouse move in event, this also means that JPanel is havi...