Calling Form-name By Variable?

Jun 25, 2010

i am currently trying to re-write an old VB6 program into .net basically the program contains 100's of forms for different jobs each with a Public Sub runjob(). the form names are then stored on a database. the user then selects the job from the listbox and it calls the correct job.the code i use to use in vb6 was

sValue = database.rsselectjobrun.Fields("callname")
Set frmName = Forms.Add(sValue)
frmName.runjob

Set frmName = Nothing i have looked into it and found this code which calls the form in .net

Dim objForm As Form
Dim sValue As String
Dim FullTypeName As String

[code]....

but i cannot get this to run anything other then the formload code. i know i can put all of this into a select case module but id rather not with the amount of forms i would have.

View 4 Replies


ADVERTISEMENT

Calling A Value From A Grid To A Variable In Another Form

Oct 8, 2009

I have datagrid in which the 0th column has ID. What i want is while clicking on the datagrid the id of the particular row has to be load in the variable in the second form. For this i have created a public variable in the second form [code]but here its not returning any value to EditID while loading the second form.

View 1 Replies

Passing Variable To Calling Form?

Sep 3, 2009

I have a form with a list box. I'm calling it as a dialog. I can get the result of which button was pressed (OK/Cancel) but how do I get the value chosen from the list?

Dim frmCreateCSVFile As New CreateCSVFile
frmCreateCSVFile.dtpFirstEndDate.Value = dtpFirstEndDate.Value
frmCreateCSVFile.dtpLastEndDate.Value = dtpLastEndDate.Value

[code]......

View 1 Replies

Calling A Button With A Variable?

Aug 15, 2011

I'm trying to call make visible an object, i can do this:

Button1.Visible = True

but, i was wondering if there is a way that i can call it like this. Lets say i have a variable 'OBJNAME' wich value is "Button1". What i want to do is to make visible the button like this:

OBJNAME.Visible = True

I want to do this because i have like 100 objects to show in the form and i dont want to code for every one of them.

View 3 Replies

VS 2008 Passing Or Calling A Variable To Another Sub?

Jul 9, 2009

Is there a way to call or pass a variable to another sub? I'm trying to reterive a variable (or even a field name) in somethign like this:

Private Sub PrintPageHandler(ByVal sender As Object, ByVal args As Printing.PrintPageEventArgs)
args.Graphics.DrawString(RS("field1"), New Font("arial", 8), Brushes.Black, 5, 5)

[Code].....

View 6 Replies

Calling A Method Over Variable Of Type Object In Vb And C#

Jul 5, 2009

in vb I can do that

sub SetFocusControl(byref ctl as object)
ctl.Focus
end sub

in c# the compiler complaint that object doesn't have a Focus method

void SetFocusControl(ref object ctl)
{
ctl.Focus();
}

how can I do the same in c#?

View 3 Replies

Calling A Session Variable In A Class Object In Asp.net?

Aug 29, 2011

How can I access the values stored in a session object with a class in asp.net?

View 3 Replies

Calling Showdialog() On A Form - From The Main Form's OnLoad Event Makes The Modal Dialog Go Away After A Few Seconds?

Aug 7, 2009

I'm having an interesting issue that I can't reproduce on a different project, but can consistently on this one. I have no clue what might be causing it, but am hoping that someone may have seen it before.

I have a main form, from which I run a series of checks. On this form, I have a listview control. Because of some issues with the refreshing of this listview control, I had to create my own messagebox. It's just a form that displays some text ( it also happens to look nicer than MsgBox; in my opinion, anyways ). It's been working great for months, until recently.

My problem is that on my main form's load event, I run this check, which returns an error within a try/catch block. I then call my custom messagebox with a message. It in turns calls it's ShowDialog() function.

In any other situation ( after the main form has been loaded ), I have no problems. The messagebox goes on the screen and behaves appropriately ( ie: waits for my input and acts as a modal dialog ( stops execution of my main form's thread ) ). However, on this onload event, my messagebox comes up and goes away almost immediately afterwards.

I've traced it all the way to the showdialog() call. For no explicable reason, it appears to skip right over this call, without me doing anything on the form.

Here's what the inner trace looks like ( when I put a breakpoint on the onclosing event for this messagebox form ):

CODE:

View 10 Replies

Pass A Variable To Another Form Or Else Make The Variable Visible To Both Forms?

Sep 5, 2010

Using Visual Basic 2008 Express. I need to pass a variable to another form. Or else make the variable visible to both forms.

View 4 Replies

Set Calling FORM Visible = False By CALLED FORM

Sep 6, 2010

Requested were made by Businese Analyst to set the few Main FORMs VISIBLE PROPERTY TO FALSE when the POPUP FORM is loaded.

[Code].....

When the MAIN FORM loads the POPUP FORM, on the FRMPOPUPCUSTOMER-FORMLOAD even, it has to set the MAIN FORM Visible to False.

When FRMPOPUPCUSTOMER FORM IS UNLOAD it has to set the MAIN FORM Visible = TRUE.

How to the coding is to ensure that different MAIN FORM when loaded FRMPOPUPCUSTOMER it will turn the MAIN FORM Visible to FALSE.

View 2 Replies

Forms :: Calling A Function From A Form To Another Form?

Jul 22, 2009

how to call a function from a different form. Like the button click event. i have this scenario. I have a main form and a child form in the main form there is a navigation panel on the left side controlling the child form. What i want is if clicking the add record in my navigation panel will call a function in the child form to execute.

View 1 Replies

Setting A Variable To Accept The Result Of A Function By Calling The Function With Many Parameters

Feb 17, 2011

I'm currently working with a client's VB.Net code, which was developed for them by a small development shop a few years ago and which they purchased and have been maintaining and uprgrading since. This client's primary developer is out on indefinite (likely permanent) medical leave and I'm now filling in until they bring in a full timer (as I'm a contractor here). My current task is to add some functionality to a the VB.Net code they purchased. I'm finding practices and techniques in the code that absolutely baffle me and can't make the code do what I want. I'm starting to wonder if it's me and was hoping to get some thoughts on the code I've encountered.

For example: Setting a variable to accept the result of a function by calling the function with many parameters, clearing the parameters in the function, setting them to some value, calling another function with those new values, then never using the values returned by the functions. I'll add a code snippet in the first comment since this is already getting long.

View 9 Replies

Calling A Sub From Another Form?

Sep 21, 2010

I have two forms and one needs to call a method from another form. I am from a java background so i do not understand why the object instaniated (if that is a correct assessment) on one form cannot Call a sub from the second form.

View 1 Replies

Calling A Sub On A Form?

Mar 2, 2009

i used the code below to find if any forms called logform are open, there will only ever be one of these open at a time...

Code:

Dim frm As Form
For Each frm In My.Application.OpenForms
If frm.Name = "logform" Then
MsgBox("found form")

[code].....

but thing is when i find the form i want to call a sub in that form's code called action if i use frm.actions() it says that actions() is not a member of [URL]so how do i do this?

View 14 Replies

Calling Form By Using As New?

Dec 13, 2009

I am just wondering the difference between using "As New" and not using it. It looks like the outcome is same to me. Is there any difference between #1 and #2 when I call "frmCR" from other winform?

A form "frmCR" is alreadu created thru design mode.
#1
Dim frmCR As New frmCR
frmCR.Show()

#2
frmCR.Show()

View 7 Replies

VS 2008 Calling Form From Another Form?

Mar 11, 2010

I have login form as start up form and i call Form1 after successful validation and in Form1, i have close button on click of Close i would like to reset username and password fields on loginform to null. If i add code in form1 below i get exception Dim fmLogin As New LogInForm

An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll

Make sure you do not have an infinite loop or infinite recursion

I get above on LoginForm below statement Dim fmMain As New Form1

How to take care of this problem

View 1 Replies

Calling A Function From Another Form?

Sep 2, 2011

Is it advisable to call a function from another form?Does it have any side effects on the system while running, like more process will consume?I have a function that will set the background in a form, it will make the image stretch, backcolor transparent and will set the picture. If I will use that function in other 15 FORMS I can minimize my code.

View 9 Replies

Calling A SWF Object From Another Form?

Jun 26, 2011

Version: visual basics 2008

Problem:

Form 1 contains a SWF object, which is called FlashGame (it has a movie set, which is a game)

Form 2 contains a button to set a variable on the FLashGame.

Example

Call FlashGame.SetVariable("variable will be here", 1)

That simple coding works when the button to call that SetVariable command is on the same form as the FlashGame, but I need them to be on different forms.

View 1 Replies

Calling Another Form's Procedure?

Jun 29, 2009

The code below is what I have in one form. Login_prompt is the name of the other form.In this code snippet I am displaying another form that prompts the user for a username and password.I then want to open the website and auto populate the fields. The populating is not the problem.I cannot seem to call on the other form's sub procedure correctly.

View 3 Replies

Calling Form Of Another Project?

Jan 19, 2011

Is there any specific way of calling the form of another application.My main project is a WPF application.From that it is calling another application is Vb.NET.. This is done by creating a process and then calling the exe.

Dim fp1 As New Process()
fp1.StartInfo = New ProcessStartInfo("Location of the exe")
fp1.Start()

Now the problem which I am facing is that from that exe I need to call a specific form in the WPF application.

View 2 Replies

Calling Procedure In Another Form?

Jul 14, 2010

There are 2 forms open for the user in a school attendance program. The 1st. form is called FormBrowseClasses and the other form is called FormBrowseGrades. On the 2nd form is a procedure called PopulateTheDataGridWithData. That procedure loads data into a DataGrid.We would like to call PopulateTheDataGridWithData from within FormBrowseGrades so the data in the DataGrid will be refreshed.

We already tried:

' Refresh DataGrid data on FormBrowseClasses
'-------------------------------------------
objFormBrowseClasses.PopulateTheDataGridWithData()

but this only runs on a new instance of the form, not the currently open form. how to set this up correctly?

View 2 Replies

Net Calling Another Form Difference?

Apr 18, 2012

What is the difference between these?

A.) Using xForm as New frmCall()
xForm.ShowDialog()
End Using
B.)Dim xForm as new frmCall()
xForm.ShowDialog()
xForm.Dispose
C.) frmCall.Show()

They are all showing the form and I know it has difference but I don't know what. Can somebody explain this?

View 2 Replies

Set Image After Calling New Form()?

Jun 14, 2010

Is there anyway I could set an image on a "NEW" child form when calling the following

(MainFrm) = Form1
(ConfigFrm) = form2

Code:
Dim Frm as New ConfigFrm()
ConfigFrm.Img_Artwork.image = Image.fromfile(Img_Location)
Frm.MdiParent = MainFrm
Frm.show

When I call the following, and the "New" child form gets called, The picturebox is left blank. I know it's because I'm calling "NEW" but is there anyway to still add the image to the picturebox even though i call "NEW"

View 7 Replies

.net - MDI Child Form Calling, Not Generation?

Jul 7, 2009

I have an MDI form with 3 nested children with in it. As of right now all it can do is display a new form.For example: each time I press the menu button, the new child form(Form1) is created. Now, if I press that same menu button a second or subsequent time a new Form1 is created and it appears over the previous one.

What I would like is that each time the event handler is triggered (a menu item_click on the parent form) that instead of a completely "new" child form being produced(a new window popping up) it would instead pull up the appropriate child form that is attached to the trigger.

[Code]...

View 2 Replies

Calling Crystal Report From A Different Form?

Jun 7, 2011

I have a mdi application that allows the user to click on a specific report from them Report Menu's. I am calling the report from main, so far this is my code. In this block of code I am calling the report and connecting to the database from the subroutine called libraryReports_click

Using dbConnection As New SqlConnection(strConnection)
Try
dbConnection.Open()
Dim strSelect As String = strSelectionCriteria

[code].....

I get an error everytime i try to load my report, it gives a report load failed error message. BTW I am meaning to change the msgbx to messagebox.show once i get this piece running. I don't know what could be the issue. Any assistance would be great. I think it may have something to do with my sql adapter.fill method.

View 1 Replies

Calling Form While Closing Current One

Jan 13, 2011

I am having problem closing current form when I call some other form from current one.For example when I use code [code]It closes the current form but does not call frmExam.vb.

View 1 Replies

Calling The Classes To Be Used In The Main Form?

Apr 3, 2012

I have an original assignment that works fine, now I need to go back and make it into classes. I am not 100% how to do this. My issues are with calling the classes to be used in the main form, and what to put into the classes.

I will post the original working assignment and my understanding of the classes.

[Code]...

View 7 Replies

Forms :: Calling Function From Another Form?

Nov 23, 2011

I have defined a function on one form. I have to call that function again on another form. Is there any way I can do it without redefining the function again and again?

View 2 Replies

Office Automation :: Calling .NET Form From VBA?

Jul 1, 2010

Given vba's fairly lamentable image manipulation abilities, I'm considering going down the VB.NET form route. My hope would be to allow some degree of interactive manipulation and then either pass the image back to vba or save it and load it in vba.I'm happy to investigate the latter part of it at length under my own steam - however, I'm not versed enough in VB.NET forms to know if calling them from (in this case) Access VBA is a practical or doable - and whether it's possible to pass data back and forth.

View 9 Replies

Return Values To The Calling Form?

Nov 24, 2009

I have a form which calls other form to achieve some functionality. How can I pass values obtained on other form to the calling form?

View 10 Replies







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