When working with TCP client sockets I often find myself frustrated with the lack of event-driven support. I usually end up writing a whole bunch of code to determine disconnects, reconnecting, etc and I figuired it's time to just write my own class for this stuff. I figuired I'd share it with all of you. The implementation is quite simple, I'll provide an example below. I have XML commented all the public properties and methods, the rest is up to you to figuire out if you want to make any changes! public partial class Form1 : Form { EventDrivenTCPClient client; …

Member Avatar
Member Avatar
+5 forum 16

I'm using this code right now: // JavaScript Document $(document).scroll(function(){ if($(document).scrollTop() >= 470) { $('div.slide-in-section1').effect('slide'); } }); And of course I did realize that whenever you scroll just a little more it will keep re-running this bit of code. But I figured I had a fix, which was this: // JavaScript Document $(document).scroll(function(){ if($(document).scrollTop() >= 470) { $('div.slide-in-section1').effect('slide'); $('div.slide-in-section1').delay(400).removeClass('slide-in-section1'); } }); But then literally nothing happened. So I'm figuring the delay is kind of being ignored or something... I don't know, just a guess. Anyways I'm just wanting a div to slide in when you scroll down to a certain …

Member Avatar
Member Avatar
+0 forum 3

Hello, what is the alternative of onkeyup event for opera mini browser for mobile in jquery/asp.net/mvc4? or what is the alternative for text box change calculation for opera mini browser? On text box key up event I am doing calculation. Thanks,

Member Avatar
+0 forum 0

I will be showing how to pass data between two forms in VB .NET. I will be using two forms, two classes which we will define, a delegate, an event, and an event handler. It is my first tutorial and is a bit long because I wanted to make it easy to follow. If you want to skip the explanation and just see the code, scroll down to "The short version:" Here is what I will be using: * A form named: MainFrm * A form named: ChildFrm * A class named: ScheduleInfo * A class named: ValueUpdatedEventsArgs An instance …

Member Avatar
Member Avatar
+4 forum 8

Ok so you boot up a textbox class. Getting this in, in my eyes merely cosmetic. I used a module named programFunction with a string named tboxtext. A Couple of Functions that take a string argument. They do all the checking, making sure it is what was either in file or typed in. Then an event in the main form named appendtext args are object and eventargs.(the norm?) Next a sub to handle the event. Once done there inside handled sub. Make a for each for the string in the module. inside the foreach append the variable for the statement …

Member Avatar
Member Avatar
+0 forum 2

I've been trying to find a way to filter the Event Viewer in Windows by the description instead of the event type/source etc. I figure that i need to use the XML tab to customise it as there is no option in the basic filtering for what I want. One reason why I want to do this is to find when I service was started. The sytem logs show when services stop and start but they all have the same event ID, Event Type and Source. The "description" I'm referring to is the text you see in the "General" tab. …

Member Avatar
Member Avatar
+0 forum 4

I'm having some problems cleaning up some of the processes my windows form application creates. I'm using selenium which starts a process instance of a browser and a browser driver among other things. Selenium library provides a Quit() method which if called inside my running application works just fine at cleaning up. My problem is, that if my app is simply closed via the rex cross I cannot call Quit(). I have tried a number of things like creating a destructor for Form1 and calling Quit there, no luck. Tryed adding the following in Form1 class... private void Form1_Closing(object sender, …

Member Avatar
Member Avatar
+0 forum 1

hello , i have this problem i cant figure if it from the gloable resources or in the event itself, so i am using 2 languages in my website's pages, one language which is not the defualt is working very well ,but the english language mode it isnt , so here i have help images beside the control that opens a small dialog contains the help text , in the other language it works and the dialog is opening ,but in english even the curser's shape isnt changed to trigger event..before the controls on both languages were working fine! i …

Member Avatar
Member Avatar
+0 forum 2

Hello All, I have searched every forum and google etc but nothing directed me in right path. Requirement: I am using a COM object which can be initialized only once. But, when I try with webapi the first run goes fine and the rest fails as the COM object does not allow initialization for second time. With the below code, I notice that the new COMClass(); is being triggered everytime there is a GET request. Is there a way I can define the COMClass object to be executed only once and can be re-used by all the GET requests? namespace …

Member Avatar
Member Avatar
+0 forum 6

I will be showing how to pass data between two forms in C#. I will be using two forms, two classes which we will define, a delegate, an event, and an event handler. It is a bit long because I wanted to make it easy to follow. If you want to skip the explanation and just see the code, scroll down to "The short version:" * A form named: MainFrm * A form named: ChildFrm * A class named: ScheduleInfo * A class named: ValueUpdatedEventsArgs An instance of ChildFrm will be created and shown when clicking a button on the …

Member Avatar
Member Avatar
+4 forum 1

Hi, On copy event, i need to display confirm dialog (we use fancybox dialogs in all project) and depending on user choice add some text (reference) to the copied text or leave the text as it is. And the problem is that - when dialog appears copy function continues to go further and don't wait till confirmation. **Is there a way to pause the event and then continue?** I know i can stop event `e.preventDefault();`. Maybe there is some way to manualy invoke copy event and pass modified text as selection? $("body").bind ('beforecopy', function (e) { if (typeof window.getSelection == …

Member Avatar
Member Avatar
+0 forum 1

Hello, i want my users to be able to create events and the event to be shown on their wall. I have this that shows a photo that they upload. <div id="imageupload" class="border"> <form id="imageform" method="post" enctype="multipart/form-data" action='message_image_ajax.php'> <div id='preview'> </div> <div id='imageloadstatus'> <img src='<?php echo $base_url;?>wall_icons/ajaxloader.gif'/> Uploading please wait .... </div> <div id='imageloadbutton'> <span id='addphoto'>Add Photo:</span> <input type="file" name="photoimg" id="photoimg" /> </div> <input type='hidden' id='uploadvalues' /> </form> </div> i have done this <div id="event_container" class='border'> <form action="announce_event.php" id="eventform" method="post" enctype="multipart/form-data"> <div id='preview_event'> </div> <div id='eventloadstatus'> <img src='<?php echo $base_url;?>wall_icons/ajaxloader.gif'/> Uploading please wait .... </div> <div align="center"> <div> <span>Event Title: …

Member Avatar
Member Avatar
+0 forum 5

Friends, in my project i'm using onblur event in four text boxes and using that onblur event i wanna call different javascript functions i.e', like first text box onblur="test()" and in second text box onblur="test1()" etc. But only one onblur onblur is calling the function and other onblurs are not working. So pls tell me how can i put more the one onblur event and javascript functions in a single page. Urgent pls.

Member Avatar
Member Avatar
+0 forum 8

HI, Am planning to write a event management for my web application ,where the Admin can schedule a program to one particular channel say like Admin --> BBC channel --> 10Am-12Am program one from 12 Dec2014 - 23DEC 2014 ..Now my question is when i write checking condition as no other program shud be allocated for the same time or if the admin selects as 9:30 Am -12Am it should pop error msg as 10-12 is already taken. I have done by checking the present time 10-12 it works roght but when i chk with 30 mins before it gets …

Member Avatar
Member Avatar
+0 forum 3

I want to maximize and minimize windows form on Timer Tick evebt. I placed the code this.WindowState = FormWindowState.Minimized; into the timer tick event. but actually its not working. Suggest me some code snippet for the same. Regards, Manthan

Member Avatar
Member Avatar
+0 forum 6

Hey all, Am new to Sharepoint development and am trying to create an Event Receiver to communicate with a Web service. Does anyone have any advice or any references that can point me in the right direction?

Member Avatar
+0 forum 0

i want to auto bind data to my textbox after user click the textbox and i already make it!! but my problem is, after i click the textbox again, it still same as the first click!!! HELP ME!!!!

Member Avatar
Member Avatar
+0 forum 5

stupidajax: function() { var varpas=$j('#somediv',window.parent.document).text(); varpas.replace(/\s/g, ""); $j.ajax({ // Start AJAX function url: 'mysqlcall.php', //script async: false, data: "parameter1="+varpas, //you can insert url argumnets here to pass to api.php //for example "id=5&parent=6" dataType: 'json', //data format success: function(data) //on recieve of reply { //start success function var selecthtml='Things: <select name="d" id="d">' for (var i=0;i<data.length;i++) { //start for var r = data[i]; var n = r[0]; var c = r[1]; if (i==0) { selecthtml=selecthtml+'<option value="'+c+' selected="selected">'+n+'</option>'; } else { selecthtml=selecthtml+'<option value="'+c+'>'+n+'</option>'; } } //end for selecthtml=selecthtml+'<option value="Default">Default</option>'; selecthtml=selecthtml+'</select>'; } //end success complete: function(data) { alert("hi"); // <----line that pisses me off …

Member Avatar
Member Avatar
+0 forum 21

Hi I have an event listener attached to something which will fire a lot based on some user action that has occured on the page or some javscript change. Unfortunately it will be something like 5 or 6 fires in the space of 250ms and I am only interested in the last fire so I can carry out the resource intensive processing. I'd like to ignore all of the fires before that. Any way this can be achieved keeping in mind we don't know how many times it will fire.

Member Avatar
Member Avatar
+0 forum 3

Hi everyone, I am a C/C++ winapi developer and have to rewrite a "Dialog based" application in java, so that it will execute as an applet in any browser. My java skills are very few, since my knowledge is limited to past college classes. The application is not a large scale one, since it only implements a GUI, with a few screen interactions, which are driven by data from udp network connections. In a windows development model, i would create worker threads wich handle the network communication and feed the gui with data through the window message queue, probably using …

Member Avatar
Member Avatar
+0 forum 6

I'm not sure if its my computer or what. For some reason when I run programs in class they go through fine but after running the same program at home it doesnt seem to work. Basically, what I'm trying to do is create an event handler that draws a circle on the canvas each time the mouse is clicked. Also, I added a count to count the clicks and print the number of clicks. I just get an empty canvas. Ofcourse, I don't want anyone to do it for me, but can someone tell me if this program won't run …

Member Avatar
Member Avatar
+0 forum 2

Telling you before hand, i am just starting to learn, so please refrain from making fun of me i k i am real weak in this. ok here is what i need to do, i have been trying for ages but i am having huge problem creating dynamic checkboxes. This is what needs to be done. When user clicks in the textbox, “Write a Quick Note” text should go away. > 3. When user writes something and presses ENTER key, it should add the text user just > entered in the checklist below that textbox. For example I write “Prayer” …

Member Avatar
Member Avatar
+0 forum 10

This, of course, is not my code. It's from my object oriented programming course book. During class I ran the program and it worked a good 75% of the time without making any changes. For some reason, when I run it at home(either on python 2 or python 3) it won't work at all. I get error NameError: name 'Monitor' is not defined. Why is it doing that? # Program: ShapeHandler.py # Authors: Michael H. Goldwasser # David Letscher # # This example is discussed in Chapter 15 of the book # Object-Oriented Programming in Python # from cs1graphics import …

Member Avatar
Member Avatar
+0 forum 3

I have a simple USB barcode reader which I intend to use to scan COD 39 barcodes. I know that just scanning the barcode while having a text field on focus will get me the text input of the barcode I'm scanning. However my requirement is a bit different. I need to create a C# application where upon reading a barcode it will check the read barcode with a list I have to see whether it exists. The problem is I cannot keep a text box on my app in focus all the time as the app does other things …

Member Avatar
Member Avatar
+0 forum 6

Hi, I am very new to PHP, and i need small help. i need to fetch data on selection box onchange event and then apply pagination to the results. i have done etching data with ajax and when i tried applying pagination i am unable to load parent page of the ajax page. here is the code follows.please help me to solve this problem. <?php include('auth.php'); $id=$_GET["id"]; //for pagination define('MAX_REC_PER_PAGE', 10); $qry ="SELECT count(*) from user_info,time_data where user_info.user_id = time_data.user_id and manager_id= '$timeapp_id' "; if($id != 0){ $qry = $qry." and user_info.user_id = '$id'"; } $results = mysql_query($qry); list($total) = …

Member Avatar
Member Avatar
+0 forum 2

Write code to record daily humidity of a place for a week

Member Avatar
Member Avatar
+0 forum 1

After seeing quite a few posts today asking about event handlers for dynamicly created controls, I have decided to give a little example for reference. **Note that you should check [Microsoft's Documentation](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx#inheritanceContinued) ( or research from web ) of any control if you are struggling**

Member Avatar
+0 forum 0

hi everyone. I want to delay the click event in a vsFlexgrid so that the double click event will run 1st. I used a timer for the delay in the click event and managed to get the value of the double click speed in the windows library for the timer interval. however i still cant make it work the way I want to. Its still running the click event rather than running the double click event 1st. hope you can enlighten me with this. here's my code. ''General Declaration Declare Function GetDoubleClickTime Lib "user32" () As Long ''Form Declaration Private …

Member Avatar
Member Avatar
+0 forum 5

i have made three drop downs month year day{1,2,3...} i want only valid day gets displayed in the drop down. i.e if jan is selected 31 is the upper limit if feb is selected 28 or 29 depending upon the year (leap or not) var monthselected,yearselected,mtype=0,visited=0; function reassembleDate(){ if(monthselected==4||monthselected==6||monthselected==9||monthselected==11) {mtype=30;} if(monthselected==2&&isleapyear(yearselected)) {mtype=29;} if(monthselected==2&&!isleapyear(yearselected)) {mtype=28;} else if(mtype==0){mtype=31;} removeOptions(); addOptions(mtype);} function removeOptions(){ var x=document.getElementById('dayselect'); while(x.length>29) { x.remove(x.length-1);} } function addOptions(mtype) { //alert('initialising'); var i; for(i=29;i<=mtype;i++) { var x=document.getElementById("dayselect"); var option=document.createElement("option"); option.text=i; try {//alert('trying'); // for IE earlier than version 8 x.add(option,x.options[null]); } catch (e) {//alert('catching'); x.add(option,null); } } } function isleapyear(year){ if((year%4)==0) …

Member Avatar
Member Avatar
-1 forum 1

I want to change an image in another place on my site when I click on the page title. I have tried doing different codes five ways to Sunday and cannot figure it out. Can someone help? Here's my code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Assignment 2 JavaScript</title> <link href="styles.css" rel="stylesheet"> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js"></script> <script type="text/javascript" src="jquery-1.8.3.min.js"></script> <script> $(document).ready(function() { $('.hover').mouseover(function(){ $(this).css('color', 'red'); $('.hover').mouseout(function(){ $(this).css('color', 'black'); }); $('p').mouseover(function(){ $(this).css('color', 'orange'); }); $('p').mouseout(function(){ $(this).css('color', 'black'); });// for the links // var changePic = $('pageTitleBanner').attr('src'); $('#masthead').mouseover( function() { $(this).css('background-color','red'); }) .mouseout( function() { $(this).css('background-color','black'); }) …

Member Avatar
Member Avatar
+0 forum 2

The End.