Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 03-05-2009, 06:58 AM   #1 (permalink)
Insane
 
Herk's Avatar
 
Location: Kansas City, MO
Need help - How to make event handler

Hello TFP, I'm am looking for some help. The company I work for, among other things, sells some identification software. In the software you can tie card desigs to a database for printing id's. Between these two layers you build a production front end for manipulating data.

We have ordered the SDK for this software. In the software you can add an event button to the production form. You can't make the button have any function without the SDK. I am an amateur programmer mostly familiar with php so I picked c# rather than the alternative .net to write the event handler in.

So I have a c compiler ready and the ability to read the code proceduraly, but I don't understand the functions it is calling or how to sort out what they are doing. I've read through the documentation, but I am left feeling like there must be some simple bridge between what I know and how this event handler business works.

How do I go about learning to program an event handler/see the bigger picture? I need to see the flow. Button is pushed - ??? - action happens.

I can send the SDK documentation to anybody willing to help. I'd love some advice, if even just a better place to pose the question, but I'm always confident there is a TFP'er out there that knows.
__________________
-Blind faith runs into things!-
Herk is offline  
Old 03-05-2009, 02:55 PM   #2 (permalink)
Insane
 
Location: at home
C and C# are VERY diffrent things.
Following assumes C# and windows enviroment.
The IDE usually generates code behind the scene for the event handling.

Here is what Visual Studio generates for a button on a windows form
this.button1 = new System.Windows.Forms.Button();
this.button1.Click += new System.EventHandler(this.Click);


Vola!, now the procedure Click in button1 will be fired when the button is clicked.

Hope this is of some help
Yours
Zweiblumen
__________________
Sodomy non sapiens. : I'm buggered if I know
Zweiblumen is offline  
Old 03-08-2009, 04:28 PM   #3 (permalink)
Psycho
 
connyosis's Avatar
 
Location: Sweden - Land of the sodomite damned
Here is a very simple example:

Code:
using System;
using System.Windows.Forms;
using System.Drawing;
	
public class MyEventHandler : Form
{		
	public MyEventHandler()
	{
		// Just setup a very very simple UI
		Size = new Size(200, 200); // Size of window
		
		// Create new button with the created window as parent
		Button myButton = new Button();
		myButton.Parent = this;
		myButton.Text = "Click me";
		// When button is clicked, run OnButtonClick
		myButton.Click += new EventHandler(OnButtonClick);
	}
	
	// Display message box when button has been clicked
	public void OnButtonClick(object sender, EventArgs e)
	{
		MessageBox.Show("You clicked me");
	}
	
	public static void Main()
	{
		Application.Run(new MyEventHandler());
	}
}
__________________
If atheism is a religion, then not collecting stamps is a hobby.
connyosis is offline  
 

Tags
event, handler, make


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 01:27 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76