473,785 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling another form

Hi everyone,
This is a very simple question, but I am new to VB.net and
can't seem to get a simple call to another form to work.

example:
If (scenerio is true) then
load frmLogin
end if

What is wrong with this statement? I've tried various
flavours of the above statement. Obviously I need a
course in .net. Is there a good site that will list all
of the differences between 6.0 and .NET?

Thanks,
Sandy
Nov 20 '05 #1
4 11038
Hi,

If (scenerio is true) then
Dim frm as new frmLogin
end if
Ken
----------
"Sandy MacDonald" <sa****@woodsto ckhydro.com> wrote in message
news:1a******** *************** *****@phx.gbl.. . Hi everyone,
This is a very simple question, but I am new to VB.net and
can't seem to get a simple call to another form to work.

example:
If (scenerio is true) then
load frmLogin
end if

What is wrong with this statement? I've tried various
flavours of the above statement. Obviously I need a
course in .net. Is there a good site that will list all
of the differences between 6.0 and .NET?

Thanks,
Sandy

Nov 20 '05 #2
Hello,

"Sandy MacDonald" <sa****@woodsto ckhydro.com> schrieb:
This is a very simple question, but I am new to VB.net and
can't seem to get a simple call to another form to work.

example:
If (scenerio is true) then
load frmLogin
end if

What is wrong with this statement? I've tried various
\\\
If (scenario is true) Then
Dim f As New LoginForm()
f.Show() ' If you want to show the form.
End If
///
flavours of the above statement. Obviously I need a
course in .net. Is there a good site that will list all
of the differences between 6.0 and .NET?


Upgrading from Visual Basic 6.0 (Visual Studio .NET)
http://msdn.microsoft.com/library/en...ualBasic60.asp

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
"Sandy MacDonald" <sa****@woodsto ckhydro.com> schrieb
Hi everyone,
This is a very simple question, but I am new to VB.net and
can't seem to get a simple call to another form to work.

example:
If (scenerio is true) then
load frmLogin
end if

What is wrong with this statement? I've tried various
flavours of the above statement. Obviously I need a
course in .net.
Dim MyForm As frmLogin

If Scenerio Then
MyForm = New frmLogin
MyForm.Show
End If

You can not "load" the form anymore. You can crate the Form and later show
it. "Loading" is automatically done before the Form is shown the first time,
i.e. the Load event is raised.
Is there a good site that will list all
of the differences between 6.0 and .NET?

<F1>
Visual Studio.NET
Visual Basic and Visual C#
Upgrading applications
Upgrading from VB 6.0
Introduction in vB.Net for experienced VB users

(see hints in signature)

--
Armin

- The tree representing the table of contents has been translated from
localized (German) version. Excuse slight deviations.

Nov 20 '05 #4
Cor
Sandy,
When it is something like a "login" form ( a dialogform)
\\\\
If (scenario is true) Then
Dim f As New LoginForm()
f.showdialog(me )
' if login.ok etc
me.dispose
End If
////
I hope this helps a little bit.
Cor
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
600
by: headware | last post by:
I know that you can call the method of one from from inside another form by doing something like this Forms("MyForm").MyFunction(12, 34) However, you have to know that MyForm has a function called MyFunction. Can you specify a string for the function name like you can with the form name? That is can I do something like Forms("MyForm")."MyFunction"
14
3013
by: ericellsworth | last post by:
Hi, I'm trying to use a class to pass variables back and forth from a form opened in dialog mode. I have created a class which invokes a form in its show method, like so: Public Sub Show() ' This method shows the form used to get the info If sWhereInt = "" Then DoCmd.OpenForm sFormNameInt, acNormal, , , acFormAdd, _
2
6612
by: mark | last post by:
I am developing an application in .Net C# that needs to restore a number of tool windows to some previous location and size. The problem I have is that when I create the form and set the Location and Size properties before calling the Show method, the form is not created in the Location that I set. If I call Show first everything works fine but there is excesive flicker when the Location and Size properties are set. I tried calling...
2
1816
by: Renzo | last post by:
hi ! i've recently begun developing in c# and i'd like to know what's the best way of calling a form from an already instanced form ? I have done a "Login" form which I run in the Main() using "Application.Run(...)", now when the user logins correctly, another form named "Calendar" must be called. How can I do this ? Should I close the first form first and then instance the new one or how ? Thanks.
6
1709
by: Amjad | last post by:
Hi, I want to make a project that calls and executes a function (VB code) made in a seperate file in the Application Folder. I know I can create the function in my project and call it internally, but I want to put the function's code in an external file, so that future updates to the function will require a replacing the function file instead of re-installing the whole project. Can you give me ideas on how I can make small updates to my...
0
2389
by: teddysnips | last post by:
I have Search form that allows users to retrieve records into a DataGrid. There are two search criteria - a Month and a Year, which are selected from drop-down lists. There is a server-side button called "cmdFilter" which retrieves data from the database using any criteria thus selected. For any of the records retrieved into the grid match certain conditions, one of the columns will be formed into a hyperlink. Clicking on this will...
3
3581
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup and then do a refresh of the calling form. Any ideas on how to get a reference to the calling form? I tried window.parent.location.reload() , but it doesn't work. Thanks a lot.
7
2949
by: Lee Crabtree | last post by:
I remember when I was first getting into .NET Forms programming that there was a rather emphatic rule about not constructing a form before calling Application.Run with it. So this: Application.Run(new Form1()); was okay, but this: Form1 form = new Form1();
1
1752
by: SAL | last post by:
Hello, I'm developing this remoting app (.net 2.0) and I need to bring the server app's form to the front often. Since you can not do cross-thread communication on a form or control without using Invoke, I declared a delegate to handle the cross-thread call to bring the form forward. Here's my code: Delegate Sub BringMeFront() Public myDelBringFormFront As BringMeFront
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.