Raising Events Between Forms And Memory Increasing?

Feb 8, 2012

My application has 1 main form and three other forms which raise events to my main form. I noticed that the memory starts at 77,000 K and increases substationally over a few hours maby be to 250,000k and ever increases.The main form has a dataset and a bound datagridview which gets refreshed with data. Basically it's a taxi booking application. The booking form raises an event to the main form and the main form refreshes the jobs and displays them on the dgv.

View 8 Replies


ADVERTISEMENT

Forms :: Raising Events Order?

Jun 4, 2012

I have 3 classes in 3 separate dll.

1) Class "BaseForm" that inherits from System.Windows.Forms.Form with "MyEvent" declared as Public Event ()

2) Class "MyForm" which inherits from "BaseForm"

3) class "MyClass" which has a public property "ExternalObject" of "BaseForm" type (the private variable is declared WithEvents)

I make the following steps:

1) intercept the Form LOAD event in "BaseForm"

- Instance the class "MyClass", Assign public property "ExternalObject" = Me

- I do a RaiseEvent "MyEvent" in "BaseForm"

2) "MyEvent" is triggered BEFORE in "MyForm"

3) AFTER "MyEvent" is triggered in "MyClass".How Can I Raise event Befor in "MyClass" and then in "MyForm"?

View 1 Replies

Raising Events And COM?

Jul 22, 2009

I have a windows application which raises a particular event.I need to create a COM callable class whic will allow VB 6.0 to subscribe to this event.I have done a fair amount of research on this and am confused as hell.

View 3 Replies

Raising .net Events From Another Class?

Aug 15, 2011

can I call shared events contained in one class from another class?

for example:

logonclass.vb : handles login logic and authenticates against database
logonmanager.vb: hold current user reference and some logon and timeout events
Logon.vb: A form with a submit button.

I would like to do something like this but I can't get the compiler to agree with it

If VerifyEntries() Then
Try
privLvl = LoginClass.AttemptLogin(txtUserName.Text, txtPassword.Text)[code].....

If this isn't the proper way to wire things together let me know so I can learn to structure differently. In my planning it seemed like I was raising a lot of extra duplicate events from my logonclass to my loginmanager class. Then the loginmanager had to raise it again for the main form to see the change event. It got me thinking that if I publicly shared the events and could raise them from wherever then it would cut down on the amount of events I needed in code and the amount of them flying around at runtime.

View 2 Replies

Raising Events Between Classes?

Dec 27, 2010

I am currently trying to make a calendar project it has 2 user controls one is the calendar and the other is the calender day control. When the month changes in the calender control I need to raise an event in daycontrol to update any holidays. In the calendar control I have the following code for the event:

Friend Event MonthChanged()
Public Sub New()
' This call is required by the Windows Form Designer.

[Code].....

View 2 Replies

Raising Events In A Collection

Jul 14, 2011

I want to have a collection of a class which inherits picturebox, with a couple of extra properties, so essentially the same. Only I get an error at runtime saying : 'An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.' Here Is my code, I know that the error occurs here :

[Code]...

View 3 Replies

Raising TAPI Events?

Jul 26, 2010

I have a TAPI program that is very similar to [URL] I have a delegate ...

Delegate
Sub TapiEventCallback(ByVal
dwMessage As TapiEvent,
ByVal dwParam1

[code].....

From my program TAPI will call the number. My problem is that its not raising any events. I really need CallStateChange. I raised it from address and moved it up to my TAPI Manager. I put break points everywhere and I can not get anything to raise.

View 1 Replies

VS 2005 COM Callable And Raising Events?

Sep 6, 2009

My windows application needs to raise an event in a COM callable assembly so unmanaged code can pick up on the event.I am sick of this. All the crazy tags required for COM callable is doing my head in.

View 1 Replies

VS 2010 HTTPWebRequests - Memory Usage Indefinitely Increasing?

Jun 23, 2011

I'm having an unusual problem that I've never had with WR's before. I have a very user-driven program that interacts with a server of mine through webrequests. Depending on what the user's doing, it could end up sending a dozen requests/minute. This has never been a problem before, but for some reason system memory usage increases and doesn't stop increasing, as if something is cluttering it up for every webrequest that is sent out.

Is there a known problem with WR's like this? Or is it just a random screw up? I can get my system back up and running smoothly.

View 5 Replies

Working Set Memory Keeps Increasing Everytime When Receiving Data From?

Jan 12, 2010

I have the following code that connects to a server and expects data from it.Is it normal that working memory of my program increases every time I receive something from the server I connect to?The larger I make the network buffer, the more increase that is added to my working memory (in task manager)The data I receive is about 50 bytes. So I minimized that size of the buffer to 128.

View 1 Replies

Office Automation :: Raising Events From Word To .NET?

Jan 8, 2009

I'm creating macrobutton fields in Word by .NET to add fields. I need someway to figure out when a field is copied and pasted. Is there a kind of event which will be reased within Word to .NET?

This is the code to generate the fields:

[Code].....

General I need to add a field to Word with a given name and a guid and when it's clicked, moved, copied or pasted. I need an event to do something with it.

View 1 Replies

Raising Events In A Class Library Exposed To COM?

Dec 20, 2010

I'm trying to write a wrapper to a service, which will be used by an existing VB6 project. I've got most of the basic framework working, except for one important aspect: I can reference the wrapper in a VB6 project and subs/function calls etc. work as expected, but events do not. The events are visible in the VB6 app, but they never fire.

VB.NET Code:

Public Event Action_Response(ByVal Status as String)
Public Function TestEvent()
RaiseEvent Action_Response("Test Done")

[Code]....

So, the cmdTest button code prints 'Done' as expected, but the Action_Response event doesn't fire. Is there something else do I need to do to get the event to fire?

View 1 Replies

Raising Events In Multi-threaded Classes?

Aug 27, 2009

Raising events in multithreaded classes?

I am running a class(gamepad handler) that uses many child threads to check for key input and the like then it raises events to my form to sort out the needed reaction, Is there a way to make the event raises on the same thread as the class itself.

View 3 Replies

VS 2010 - Correct Convention (style) For Raising And Handling Events

Apr 4, 2012

the question is really what is the correct convention (style) for raising and handling events. When a button is clicked it is generally handled by this method. [Code]

I have recently been trying to follow this convention by creating my own EventArgs class and inheriting the system.eventargs, Then adding my own properties. The problem is as my projects get bigger/complex I seem to be writing multiple eventarg classes. I then decide to try and create a generic eventarg class but this then seemed pointless thinking it would be easier just to pass the object directly instead of wrapping it up in "someEventArg" i have created.

View 4 Replies

VS 2010 TabControl With DragDrop Not Raising MouseClick Events On Tabs

Aug 29, 2010

I have a custom (inherited) TabControl which adds Drag/Drop functionality to it, so that one can drag the tabs around, either within the same control (to re-order them) or to and from other TabControls. I've noticed some time ago that my TabControl however was not raising its MouseClick and MouseUp events (or actually: it is not calling its OnMouseClick and OnMouseUp methods, which comes down to the same thing). I've been struggling with this problem for a long while and I finally figured out what is happening. I'm no closer to figuring out what to do about it though... The problem seems related to the drag drop functionality. I have this code in the OnMouseDown method (which is raised as usual):

[Code]...

View 10 Replies

Raising Events With FakeItEasy In .Net To Verify That Event Handler Is Wired Properly?

Apr 27, 2011

I am attempting to test that the event handlers between an interface and controller are wired properly. The system is set up like the example below:

[Code]...

View 1 Replies

Two Objects That Are Raising Some Events - Pressing A Button - Raise A Custom Event, Then Execute A Method And Then Close The Form

Mar 30, 2011

Problem that you may have when dealing with two objects that are raising some events. Here, to make it obvious, I am closing the form, but the problem can be experienced with any other 2 classes event. First, what is the problem !

Let suppose that by pressing a button, you want to raise a custom event, then execute a method and then close the form

In that case, you may use a code similar to this

Event BeepIt()

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RaiseEvent BeepIt()

[CODE]...

View 14 Replies

Child Objects Raising Events In Parent Objects?

May 1, 2009

long story short, I have created a ListView type control, using UserControls for the parent control and the ListViewItems. Most the of the control is written and works fine, right up to the point where I tried to replicate the 'Control.SelectedItems(0).Index' property and the 'SelectedIndexChanged' event.

Each child object knows its index value, and could pass this value via the SelectedIndexChanged event (assuming this is how it works in a normal ListView control -- user clicks on an item, and that item fires an event updating the selected index value in the parent object).

How does the child object raise an event in the parent object? I have a feeling this could be done with Delegates, but I'm still learning about their usage.

View 1 Replies

Forms :: Increase A Forms Opacity Without Increasing The Opacity Of The Controls In The Form?

May 30, 2009

How to increase a forms opacity without increasing the opacity of the controls in the form?

View 1 Replies

Events And Why RemoveHandler Is Required For Memory Leaks

Feb 18, 2010

I have attempted to understand the behind-the-scenes stuff for Events several times. I must have read at least a dozen articles but there is still some ambiguity in my head.

[Code]...

View 5 Replies

Forms :: Multiple Forms, Closing Events And Sub Routines?

May 25, 2010

I have googled high and low to find an answer to this but I must be searching wrong.I have an application which has a listview displaying some items that are stored in a SQL Compact database. I am using a second form to add new items to this list directly into the database.When the second form closes I want to call the sub in my first form to refresh the list from the database.

How can I get it to fire the form1 sub routine on the close event of form2

View 3 Replies

Using Events For Communication Between Forms

Dec 4, 2009

I am bringing back here the subject of the communication between forms. The reason for this is that in a recent discussion in this forum it was conclude that using the events for communication between forms was a good practice. In a first time, I want to say, and everybody should agree with this that no form should never access directly any value or control values that belong to another form. There are many reasons for this but the principal one can be seen in this example

IN FORM1:
TextBox1.Text="CrazyPennie"
Dim MyNane as string = Textbox1.text
With this code, Form1 will expect "MyName" to have the value "CrazyPennie".

But, if Form2 does access the directly the controls of Form1, it is possible for the value of MyName to be set to something else since Form2 can have changed the value of TextBox1.Text before the assignment by Form1 to MyName. Now, what is wrong about using the events for the communication? The problem is that an event is broadcasted throughout the entire application, so the conversations in between two forms are not private.

Look at this scenario:
You have 3 forms in an application that communicate with each other with events. It is then possible for Form3 to listen to a communication between Form1 and Form2. It is also possible for Form3 to make the error to believe that the message send by Form1 to Form2 was address to itself. In this case, Form3, following this message may take some action that should not have been done and that result in some undesirable repercussion throughout the application.

This code keep the communication in between 2 forms private so no other forms or class in the application can listen at it and accidentally take an undesirable action due to a mistake.
Option Strict On
Public Class Form1
Delegate Sub MessageDelegate(ByVal sender As Object, ByVal Message As String)
Dim Form2 As New Frm2
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
[Code] .....

View 10 Replies

.net - Visual Basic Forms Each Run In Separate Memory?

Aug 10, 2011

Do visual basic forms each run in separate memory and if not is there a way that I can force them to do so. I want them to be in separate memory so that if one form freezes the entire program won't.

View 2 Replies

Forms :: DataGridView: Slow And Uses >1GB Memory - Can It Be Optimized

Jun 22, 2011

The following snip of simple code runs pretty slow on my computer, and I suspect that it is due to excessive memory usage, since the program reports using >1GB mem according to TaskManager. Am I using the DataGridView in a wrong way? Instructions: Make a windowsforms application and put 2x button and 1xDataGridView on it. Push button1 and then button2 - sort the data in the DataGridView by a different col and push button2 again. It'll go above 1GB mem usage! Basically I need to display a lot of data to a user and allow the user to sort the data and generate something from them.

Public Class Form1
Public dt As DataTable
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
dt = New DataTable

[code]....

View 5 Replies

Events Transfering Values Between Forms?

Feb 6, 2009

I have a form set up that allows the user to do many things to manipulate items. One of the things they can do is replace an item with another. To do so, what I have them do is click the Replace button on the main form. This calls the show of a choose replacement form where there is a grid view containing the replacement options and a Replace and Cancel button. When the user selects a product from the grid, and clicks the replace button, I want the item's ID to be sent back to the main form to be used in the replacement sub.This is what I have:

Main form:

Form Load:

AddHandler replaceComponentForm.Replace, AddressOf Me.Replace
ReplaceButton.Click[code].....

The problem is the events don't seem to be reaching the main form. The replacement form closes, but Replace does not get called in the main form.

View 3 Replies

Forms - Tabbed Webrowser Events

Aug 16, 2011

I have a tabbed webbrowser I want to add an event to it to make it so IE doesn't pop up when I click a link, with a normal webrowser that is easy but I guess I have to do a handler with the tabs being part of the browser and all. I have little experience with handlers. [Code]

View 4 Replies

Forms :: Get Events Of Declared Control?

Mar 23, 2009

I declared a browser in my VB.NET project (Dim browse as new WebBrowser). How am I supposed to get to the events (browse_NewWindow) of the declared thing?Oh yeah, my code for my browser is CType(TabControl1.SelectedTab.WebBrowser(1))

View 4 Replies

Forms :: Multiple Key Events At Same Time?

May 6, 2010

How can i code my application so that it can handle two sets of key events at the same time? For example, if I was making a game where one player used the WASD, and the other the arrow keys for moving, how can i make it so that both can move at the same time? The code I used only allows one to move at a time.. (key press event, If e.KeyData = Windows.Forms.Keys.down then.... etc)

View 1 Replies

Forms :: PointF Lose Y Value On Some Events?

Mar 27, 2010

i'm making a astoroids clone and i use pointF to store units position, but they lost y value on events like form.losefocus(i think)Is there any ways to prevent this?

View 1 Replies

Forms Controls And Mouse Events?

Jun 16, 2009

I have a form with 2 contols that I with to connect by drawing a "wire" on the screen. It goes like this: you mouse down on the first control then move the mouse while holding the mouse button down. When the mouse is over the 2nd control the mouse button is released and the controls are wired.

So I am playing with mouseup, down, move, etc. When the mouse is over the first control I get mouse moves from that control, but when it moves off the events stop, and I get no events from the form even though the mouse is there.

Is there a way to do this? I have seen it done in a Java app. I could brute force it and just draw a box on the form instead of a control, but that sounds like a step back.

View 7 Replies







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