Winforms - Calling A Method From Different Class To Write Text On A Form?

Dec 5, 2011

I have two forms Form1 and Form 2. I am passing a function with three values from Form1 and want the load event of form2 to trigger this function.. Basically I want to "paint" the values of qseq, midline and hseq on form2

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

[Code].....

When I run this, nothing gets printed on form2 as when load event is triggered thee drawstring method is not called. how can I call drawstring from load method as drawstring takes in arguments and is called from Form1 class.

View 1 Replies


ADVERTISEMENT

C# - Calling A Method In A FACTORY Class When Application Is Closed / Disposed Without Using Application's Dispose() Method

Mar 28, 2012

I am indifferent if you are a VB.NET or C# or other .NET developer. I have a FACTORY class like the following:

[Code]...

View 2 Replies

Calling Method From Class In VB 2010?

Jul 18, 2012

essentially I need to create a class that houses the methods and then call the methods in the form but I can't seem to find out what the right code is to call it. I think there may be an issue with the conversion from a double to a string.

This is what I have for the Class

Public Class Aircraft
Dim Names() As String = {"A-747", "A-737", "C-150", "D-240"}
Dim TakeOffVelocity() As Double = {250, 264, 270, 240}
Dim Acceleration() As Double = {33.5, 44.2, 37.1, 51.9}

[code]...

View 3 Replies

Finalize Calling Class Method?

Mar 21, 2012

I have a logging class that stores entries in a datatable dt. I then use SQLBULKCOPY to write that dt out to a sql table. Basic stuff. Problem is, I'd like to only call SQLBULKCOPY when there's say 50 entries in the dt. The problem is, what if I'm done (either intentionally or not, like if the code block that's using the log class throws an exception) with the logging object and there are still 15 rows in the dt?

View 1 Replies

VS 2008 Getting Information From Calling Method's Class

Apr 11, 2009

I'm working on a base class right now, here's a basic rundown of it:[code]The problem is, in the Public Class bar example, some classes may implement MyInterface, and others don't. What I'd like to be able to do is have the sub New() in the structure in the base class "Foo" be able to tell if the class calling it (either the Base class, or the child class) implements MyInterface or not.

View 8 Replies

Forms :: Way To Return Multiple Rows Of Data To Calling Method Via Class Property?

Jan 28, 2009

I have this application which has one class. I need to return a recordset of data to the calling form. If i use Properties to return, it can only return only a single value at a time. Right now i'm returning a datareader object with one of the properties.Can anyone suggest a better way to return multiple rows of data to the calling method via Class Property?

View 1 Replies

Winforms - Dispose Method In Form's Designer File?

Sep 12, 2011

<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try

[code].....

View 1 Replies

Create A New Class That Inherits From The Base Form Class And Define A New() Method With Parameters?

Oct 1, 2008

I've been creating short test apps repeatedly to try to understand some of the concepts in VB.NET.For the most part it has been illuminating.I read Bucky's .NET knowlegebase tutorial on passing objects as parameters to newly created forms. He shows how to create a new class that inherits from the base form class and define a New() method with parameters Extending the concept I thought about doing the same thing with a form that was created at design-time (In this case Form2).

[Code]...

View 6 Replies

Does Calling The Dispose Method On A Windows.Forms.Timer Call It's Stop Method

Nov 12, 2009

Does calling the Dispose method on a Windows.Forms.Timer call it's Stop method? Or should I stop the timer before I dispose it?

View 5 Replies

Reflected Method From A Loaded Assembly Executes Before Calling Method?

Jun 9, 2009

When I am loading an Assembly dynamically, then calling a method from it, I appear to be getting the method from Assembly executing before the code in the method that is calling it.It does not appear to be executing in a Serial manner as I would expect. Can anyone shine some light on why this might be happening. Below is some code to illustrate what I am seeing, the code from the some.dll assembly calls a method named PerformLookup. For testing I put a similar MessageBox type output with "PerformLookup Time: " as the text. What I end up seeing is:

First: "PerformLookup Time: 40:842"
Second: "initIndex Time: 45:873"
Imports System

[code].....

View 9 Replies

Strongly-typed Generic Method Invokes Its Argument's Base Class Method Instead Of A Shadowed Method In T?

Oct 19, 2010

Consider a MyForm class that contains a shadowed implementation of Show(). It also contains a CreateForm() method, which accepts an instance of the form and calls the shadowed sub:

[Code]....

View 3 Replies

Calling A Method When The Method Name Is Contained In A String?

Oct 5, 2011

Let's say I have a page Test.aspx along with test.aspx.vb.Test.aspx.vb contains a class name "TestClass". In that class I have method1(), method2() and method3()I need to be able to call one of those methods, but I can't hard code it, the method to be executed comes from a string.

I can't do
Select Case StringContainingTheNameOfTheDesiredMethod
Case "Method1"

[code]...

View 3 Replies

Forms :: Form Object Access From Class Method

Oct 22, 2009

I want a string and a listbox, both which are in a form to be modified by an instance of a class method. Should (could I):

1. Pass the entire form to the class method as parameter.

2. Pass the listbox and the string to the method as parameters.

What's the best approach to get access and modify this string and listbox on the form.

View 3 Replies

Winforms - Add Text To Form Without Interaction?

Mar 14, 2010

I have a winform project which lists all the files in a specified folder. It allows the user to select a new destination for each file, and when the user has chosen the destinations for all files that he would like to be moved, it moves the files, one by one.My next step is, I need to display a confirm form when the files are being moved, and add each file's name and destination to the confirm form as it is being moved.How can I add more text to the confirm form's controls after I already loaded it (using confirm.showdialog() from my other form, without any user interaction? I imagine that I need to do it from the original form, because it needs to display each one when it starts to move that file?

View 3 Replies

Class - Call A Method In The Default Instance Form Instead Of Instantiating Another?

Nov 15, 2009

When an instantiated class calls a method in the parent form class, VB.NET starts a new instance of the form class instead of calling the method on to the active one.How do I tell it that I have just one instance of my form class, or that I don't want to create a new instance of the form and just call the method on the already active form?

View 2 Replies

Winforms - Make The Form Title (form1.text) Moving?

Mar 11, 2011

is there any way to make the form title(form1.text) moving?like marquee in HTML?

View 2 Replies

Write Text From A Parent Form To The Active Mdi Child Form VB 2010

Jan 28, 2012

It has to be a simple line of code but I do not know how to construct it. Using VB 2010 Express, I have a MDI parent form and many child forms. I want the parent form to determine what child form is active and load data into the RichTextBox1 on the child form. Each Child form has a RichTextBox1. The parent form gets its data by loading a file.

I am close to a solution but just can't get there. You will see in the code below, if I make a direct reference to a specific child form, it works great. What I want to do is to use the Active Form function to determine which form to write to. I have looked at the MS tutorial which gets me close.

Private
Sub OpenToolStripMenuItem_Click(ByVal sender
As System.Object,

[Code].....

View 6 Replies

.NET Multithreading / Calling Invoke On A UI Control From A Class In A Separate Class File?

May 13, 2011

Example:

Two files - TestClass.vb, myForm.vb

TestClass.vb looks as follows:

Imports System.Threading
Public Class TestClass
Private myClassThread As New Thread(AddressOf StartMyClassThread)

[code]....

The result:Application runs, no errors or exceptions.Displayed is the listbox and the Start button.I press the start button and a msgbox says "Not Invoked" as expected and upon clicking OK to that msgbox "Start Button Pressed" is added to the Output listbox control.Immediately following that the msgbox pops up again and says "Not Invoked". I was expecting "Invoked" as a separate thread is trying to use the Output listbox control.Of course this results in the Output.Items.Add being attempted which results in no visible result as the thread is not allowed to directly update the UI control.

View 1 Replies

Get The Name Of Parent Method/class/file Name Inside Other Method Call?

Feb 16, 2010

I will try to explain what I need.Let's say that I have a class like this:

Public Class Example1 Public Sub ToBeCalled()

[Code]...

View 5 Replies

Getting The Name Of The Calling Method

Sep 14, 2009

Basically i've got a web service that i'm trying to put some kind of usage logging in. To do this i've created a class with a logging method. I instatiate the class on the service and then call the logging method in each of the web methods.

[Code]...

View 5 Replies

Call A Method That Compute Some Data That Method Is On Another Form In Windows Form Application?

Mar 17, 2012

i want to which way is better when concentration is on processing speed. i want to call a method that compute some data that method is on another form in my windows form application then what you prefer is better way 1) to call that method in another form and use returned value or create similar method in form where it is required.i want to make it's processing fast.

View 3 Replies

Calling .DLL Method From Timer_Elapsed?

Nov 25, 2009

I have a .dll file (Interop.ACTMULTILib.dll) that I use to connect to a PLC. This .dll contains a sub called ReadDeviceBlock2(byval devicename as string, byval size as integer, byref data as short).My console application startup thingy is a module. When I call this method in my main it works fine, if I call it from another method that was called by main it works as well.However, it doesn't work when I call it from my Timer_Elapsed sub? I guess this has to do something with threads but I can't figure it out.

Module Main
Private Timer As New System.Timers.Timer
Private PLC As New ACTMULTILib.ActEasyIF
Private DataSet As new DataSet

[code].....

View 7 Replies

Calling A C# Method Using VB Code?

Jan 26, 2010

I have a project that has some VB code in it that I'm not allowed to convert to C#. I work in C# and not very good at VB, but I am needing to modify that VB code to use some C# methods I created.

For example:

C#:
Code:
using MGCIS2.Reporting;
using CrystalDecisions.Shared;

[code]....

At this line in the VB code (Dim crv As New Tax.Reports.CrystalReportViewer(_rdbc)) it is giving me an error:Too many arguments to 'Public Sub New()'

View 1 Replies

Calling A VB Extension Method?

Feb 23, 2012

I converted some code from c# for a VB.net project I have an object declared as this :

<Serializable()> _
Public Class oUserApplication
Public ApplicationID As Integer = 0
Public ApplicationRoleID As Integer = 0

[code]....

View 3 Replies

Calling Collection(Of T) First() Method

Jul 6, 2009

I am having some problems calling the First() method of the System.Collections.ObjectModel.Collection(Of T) class. My front-end web application is VB.Net 3.5, and the data access layer is C# 3.5. Here is pretty much the sample code I have:

[Code]...

View 3 Replies

Calling Method Between Child MDI?

Apr 22, 2010

I have a form call form1 which is a mdi tab. Within form1 there is a datagridview and a button. When the button is clicked it will fire a method within form1 to update and repopulate the dgv.

Now my problem now is that I have another form call form2 which I load using .showdialog. Whenever I update the data within form2, it will fire method from form1 and update the dgv in form1. However the dgv doesn't seem to repopulate the updated data.

View 6 Replies

Calling Method From App_Code?

Mar 26, 2012

I have method that exisit in APP_CODE class and I want to call it from Class Library what is the best way to do that?

View 1 Replies

Get FILENAME Of Calling Method?

Nov 12, 2010

I've got some debugging code that looks like this[code]...

The purpose of this code is to output the name of the calling method. Now, I would like to output the FILENAME where the calling method resides. Is this information available?

View 1 Replies

Calling A Method From .dll Globally In C# Application

Aug 26, 2009

I am using a .dll called Kiosk in my application which is resonsible for disabling some keyboard keys. I am doing like this... using Kiosk; public static Kiosk.Kiosk KIOSK = new Kiosk.Kiosk();

[Code]...

View 2 Replies

Calling A Method That Has A Period In Front Of It?

Jul 13, 2010

I am maintaining some VB .net code and noticed that they call a method with a period in front of it. What does that mean?

View 1 Replies







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