Pass A Handle In A .NET Form To C For It To Draw On/get Click Events?

Jul 20, 2009

I am trying to put a new face on an old C program. The C program is, of course, unmanaged code, designed smartly to separate the number crunching and the interface, and the interface I'm trying to replace is X windowing. The graphics part is where it gets a little hairy, because the C is going to need to continue to draw in my new interface, based on the data the program produces. Even if I want to duplicate that data in .NET so that the .NET side can handle all of the drawing, the fact remains I'm going to need to operate on the graphics window in some fashion from C.

I gather that handles have a lot to do with the bare Win32 graphic operations. Is such a similar handle provided to, say, a PictureBox element in .NET? And if so, is it the kind of handle I can use in the unmanaged code without an issue?

I have tried and tried and tried to google for the solution for weeks now, and all I come up with are either C++ solutions (using object-oriented GDI+) or some sort of extension to the C language.

Alternatively, is there a way I can have .NET create a handle specifically for this purpose of having C draw it?

To sum it up, I am using Visual Basic .NET 2008 and a C DLL (also compiled in VS2008), so far in the little testing I've done, I've been able to marshal complex structures to and fro, but I am not sure how exactly I'd let C do any drawing on the .NET form, if that was even possible.

View 2 Replies


ADVERTISEMENT

Handle Click- Events Of Dynamically Generated Buttons?

Sep 20, 2010

Am on creation of touch screen UI system.And am generating button for selecting products

Under certain category.

--> array of button creating dynamically And placing in TABPAGE when user selects Tab for category. The button will be created with the name of products, Under the category selected.

{
'the way am creating controls.
mybutton(j) = new button()
mybutton(j).top = 100
}

How can i get the Click event of those buttons-( in the array)....??

View 2 Replies

Variable Does Not Pass The Value To The Other Click Events

Mar 15, 2010

I have 3 click events in my form. I have delcared a string variable called sVariable in the following format: Public sVariable As String but when I try to use the value from the sVariable variable then it does not pass the value to the other click events. so in the Button1_Click event i type the following

[Code]...

View 10 Replies

VS 2008 Call Procedure To Handle All Control.click Events?

Jul 27, 2009

I am trying to make a routine that will be called everytime the mouse button is clicked. I want it to be called so that the controls event that the mouse is clicked on is triggered.

For example:

You have a button control on your form. Instead of having the Button1_click event

You have a Control_click event. And that Control_Click event will be used for each control on the form.

View 11 Replies

VS 2010 Form Unable To Handle Other Events?

Apr 7, 2011

I'm trying to use a asynchronous UDP-Port to recieve data on a form.I manage to receive one message at a time(for each click of btnReadData), however if I do this receive in a loop (in order to continously receive new messages), my form seems to be locked.What am I doing wrong?

Public Class FPR2DIS
Delegate Sub dDataReceived(ByVal Data As String)
Dim UDPWorker As New Worker

[code].....

View 3 Replies

Draw Graphics Onto A Form Without Using The Form_paint Or Form_load Events

Sep 18, 2010

I want to draw graphics onto a form without using paint or load events.

This Example works untill the graphics get covered and uncovered. Then the graphics vanish.

Public
Sub DrwBrdrBx()
Dim DrwBrdr

[Code].....

View 12 Replies

Use Form Handle In Class Without Pass It As Argument?

May 3, 2012

I'm writting a class that needs the form handle but there is a way to use it without send it as argument in the class constructor or in a property?I know that the handler is not set until the form is completely loaded so that is another problem too.The basic idea is catch the form handle without pass it as argument and handle the wm messages.

View 2 Replies

Asp.net - Handle Master Page Button Click Events In The Content Page?

Jul 2, 2011

I have master page in ASP.NET. I have added two asp controls to master page i.e. _EmpDROPDOWN and _findBUTTON.I have one content page. FindEmployee.aspx which shows result list of employees (Gridview) based on the selection made in _EmpDROPDOWN when _FindBUTTON is clicked on Master Page.I dont know how to read Master Page button click evenet in Content page.How to read master page button click event (VB.NET syntax) in Content Page?

View 1 Replies

Handle Events And Notifications From Multiple Sources To A Main Form In .net?

Sep 23, 2011

I have a vb.net application in which there is a main form. There are around 10 classes each having their own functionalities like tcpactions, fileactions, serialport actions etc. The user interacts with the main form and does certain actions which will invoke the methods in these classes. Now I have a notifications textarea in the mainform and i want to show the current action being performed in those classes and their results in the notifications area.

for example when a user clicks a "Start Process" Button in the form i invoke the method "launchprocess" in a class "ProcessActions". Now this method tries to launch about 7 different process and after launching it sends notification such as "process 1 launched" or if it fails it sends notifications such as "process 1 launch failed".

I currently use event handlers and use them to show notifications but with the amount of events i have to handle it is getting cumbersome and i might have to add even more classes in the future. So is there a better way of handling notifications from other classes.

View 1 Replies

Handle Events From The Main Form In A Separate Class Or Module?

Feb 24, 2012

I've been searching for the answer for a while but can't find it yet. Basically so far I have a simple VB.Net form with one button.I would like to make a class or module that can handle events from the main form. This is my code so far but it doesn't seem to work.

View 6 Replies

Get Form Click Or Form Control Mouse Events To Fire DURING Form LOADing

Aug 26, 2011

Im Using VB 2008. I have MsgBox() statements in all Mouse & Form Click events to TEST & NOTHING FIRES during Form Load when I click on Form or Button Controls !!! The Form Load event contains code for Displaying the Label.Text control many times with changes in the Text to simmulate annimation.

[Code]...

View 7 Replies

Handle Form.MaximumBox.Click?

Aug 10, 2009

Is there a way to handle form.maximumbox.click in .net 1.1?

View 4 Replies

Way To Receive Click Events Back To Form From A WebBrowser Control

Jan 22, 2012

I've been trying to figure out a way, to receive Click events(Clicking a Link) back to the form from a WebBrowser control, as the BeforeNavigation2 event does not fire in either VB/C#.Has any body got any ideas how to do this as All the example I've seen in the past just dont seem to work in VS2010

View 6 Replies

Pass Value [ Data Grid View Click ] To Another Form?

Sep 2, 2011

I'm currently working on a form with a data grid that is bind to my database [ materials table ]

basically, the data grid is being used as inventory view of the materials

what i would like to do is when the user clicks/double clicks the data entry in the datagrid

the data would be pass to another form [ i would be using this as my edit/update and delete data ] [code]....

View 8 Replies

.net - Handle ALL Events In One Handler?

Jul 19, 2010

Is it possible in VB.NET to easily write an event handler that will handle every event that fires? I'm wondering if one could make a logging system using something like this.I'm wanting to do something like (in pseudocode):

Public Sub eventHandledEvent(ByVal sender As Object, ByVal e As EventArgs)
File.Write(sender.EventName)
End Sub

I realize it would be slow, but it wouldn't be for a production system, only as a development tool.

View 2 Replies

Handle Events In Another Class

Sep 2, 2011

I'm trying to move some code into some class files to clean up my code. One area I'm having trouble with is reporting progress for events between the object performing the task and a progress bar. I guess the event functions have to be placed in the new class but they also need to update the progress bar on the calling form? Can the classobject return updates in place of the event handlers?

[Code]...

View 2 Replies

Handle Key Events In Background

Apr 17, 2009

I need an application in background that handles key events in other applications. Really i only need to know if user press F7 key, and after call some functions. I try with

[Code]...

View 1 Replies

Vb6 Handle .net Com Class Events?

Nov 13, 2009

i have the ComClassSearchCustomers class and interface IComClassSearchCustomersat .net which used to create a tlb file. The class raise an event inside new. After that i have a vb6 form Form1 which catch the event , but it never see the event.

[Code]...

View 3 Replies

Window Handle Changes Between Events

Aug 1, 2011

I have the below code. When I execute this code, the handle is different between the Load event and the Shown event. I thought the handle was static for an instance of a window. What could cause the handle to change? The only other thing the form is doing is setting itself to invisible and setting the ShowInTaskbar = False in the Activated event.

[Code]...

View 2 Replies

Events - How To Handle Multiple Textboxes

Aug 9, 2010

I have multiple textboxes which I want them to perform the same thing upon clicking them. By default I can use the handles textbox1.click for 1 single textbox but I am not sure how to do handle multiples of them. Of course I can write a handler for every single textbox but I have about 50.

Sub TextBox1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Click
If Button9.Text = "Make Changes" Then
If TextBox2.Text <> "" Then
Frm_Cine1.Show()
[Code] .....

View 1 Replies

Handle All Keypress Events Within A Single Sub?

Dec 17, 2010

From within the same form is this possible? I could eliminate a ton of code if this were possible.

View 8 Replies

Have Background Thread Handle Events?

Apr 7, 2011

I am in the planning stages for developing a VB.Net class (let's call it OpDAq) that is to obtain data via an API provided by a COM object (AxInterop.TWSLib) that makes requests to an Internet server. The API provides data via events. Class OpDAq should do its work on a separate thread; it takes several seconds (sometimes up to ~10) to collect the desired data. One should be able to create several instances of OpDAq in order to collect data in parallel. The class would be given a reference to the TWSLib object when its constructor is called, as well as several parameters. There needs to be a way for the class to provide results, preferably in the form of a generic list.

View 6 Replies

IDE :: Handle The Events For This Type Of Objects?

Jan 15, 2009

I created a Class which inherits Combobox and the listview is added . Now what I need is once the user click listview, the listview has to close and the clicked item has to added with combobox text. simply can say combobox1.text = listview.item(0).textFor closing & displaying the listview I need to handle the events. For

My Codings :========Public Class Combu_lstviewInherits ComboBoxPrivate treeViewHost As ToolStripControlHostPrivate Shadows dropdown As ToolStripDropDownPublic mylistview As New ListView
Public Sub New()mylistview.BorderStyle = BorderStyle.Nonemylistview.View = View.Detailsmylistview.HeaderStyle =

[code].....

View 1 Replies

VS 2005 - How Many Events Can Routine Handle

Apr 21, 2010

Is there any limit to the no. of handles assigned to an routine. Well actually my form form has about 80 controls and when ever the user press the enter key, focus must be to the next control. so can I handle all the 80 keydown events in one routine, or is there an better way.

View 3 Replies

MS Access Automation - Click Command Button (Click Events)?

Dec 16, 2009

I am writing an Automation program to control an MS Acces applcation. Here is the sequence of events:

- Load MS Access Database (Done)

- Load an MS Access form (Done)

- Take dates from Main.VB and populate 2 fields in MS Access form (done)

- Load another MS Access form called Stage_2 (Done)

- Load a file name into a filed in the Stage_2 form (Done)

- Do a click event in MS Access linked to a button called Pre_Stage_copy on Stage_2 form (How do I do these?)

- Do a click event in MS Access linked to a button called Pre_Stage_import on Stage_2 form (How do I do these?)

View 6 Replies

Use ToolStripMenuItems Without Mouse Events ( Click Or Double Click Event )?

Apr 4, 2010

I have a solution in Vb.NET 2008 windows Form with ToolStripMenuItems, but I need to implement menu navigation without any mouse intervention.I only found mouse events In ToolStripMenuItems, MenuStrip, etc.All MenuStrip and ToolStripMenuItems are created programatically, reading user permissions from Database, then add a handler to manage the events, but the client don't want mouse interaction, he wants only keyboard inputs only ![code]

View 2 Replies

ASP.net: Handle Events From Dynamically Added Controls?

Jun 22, 2009

I have a number of user control dynamically added to a page, and user interaction with these dynamically added user controls need to be handled by the control's parent. Is this what is referred to as "event bubbling"?How do I do that in VB?

View 3 Replies

C# - Handle Events Of Members From Another Class / Instance?

Jul 14, 2010

I am attempting to share a sub menu among several different parts of an application so that it is consistent (not wanting to copy/paste.) I thought it would be simple. I am doing something like this:

[Code]...

View 3 Replies

Handle Events For Objects NOT Created In The Design Tab?

Jan 10, 2012

I have created a PictureBox array to hold 104 playing cards that are all visible at the same time.I did this with this line in the declarations:Shared Card(104) As PictureBox

And with these lines in the Form_Load module:

For I% = 1 To 104
Card(I%) = New PictureBox
Card(I%).Name = String.Format("Card{0}", I%.ToString)
Card(I%).Size = New Size(71, 96)

[Code]...

I have been successful in creating the array, positioning each and entering the images for all 104 PictureBoxes, but now I want to add code for the event "MouseDown.I copied the code for this event from my VB3 program and VB10 automatically updated the list of parameters, but nothing has linked the objects (Card) to the code.

I have tried to append "Handles Card.MouseDown" as well as several variations with brackets to indicate that it is an array.Auto-complete doesn't include "Card" as an option, and of course, since the array was never an object added to the form design, I can't create the empty module from there.

View 7 Replies

Handle Events Of A Control In A Class File?

Feb 22, 2010

if I wanted the button onclick event in a different class how would I declare it?

when I refer back to the form it says I need to declare with events..

Private Sub btnAddToLaneFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dispatch.btnAddToLaneFilter.Click
If Me.txtCriteria.Text = "" Then

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved