473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Showing a form in VB .NET

I'm new to VB .NET and having trouble displaying a form using a button on the
startup form.

In VB4 I simply used the following to load a form as modal when a button was
clicked.

formName.Show 1

I can't seem to do the same in VB .NET.
Nov 22 '05 #1
4 2255
Hi Rick,

I believe you are looking for

formName.ShowDialog()

formName.Show() will display it as modeless

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 22 '05 #2
VB6 and below automatically created a default instance of a form. VB.Net
does not.

You have to declare it and then instantiate it

Dim myForm as formName = New formName
formName.Show
"Rick" <Ri**@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
I'm new to VB .NET and having trouble displaying a form using a button on
the
startup form.

In VB4 I simply used the following to load a form as modal when a button
was
clicked.

formName.Show 1

I can't seem to do the same in VB .NET.

Nov 22 '05 #3
Rick,

To make both previous messages one
Dim myForm as New formName
formName.showdialog

Cor
Nov 22 '05 #4
Since the main form is already open,and does not have default instance
defined, how do you access its controls from a sub from?

For instance form1 is my main form, and I create from2, and show it from
form1. Then from from2 I want to change a label text on form1.

Thanks in advance.

Jerod

"Cor Ligthert" wrote:
Rick,

To make both previous messages one
Dim myForm as New formName
formName.showdialog

Cor

Nov 22 '05 #5

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

Similar topics

2
by: c.anandkumar | last post by:
Hi All - I have some problems getting a small piece of javascript working correctly for Firefox. Here is what I am trying to do - 1. I have a form (like a search form) 2. I have many groups...
2
by: Steven C | last post by:
Hello: I have a C# app that I'm trying to build. I have three projects in the solution, the first of which stores the base object definitions (base form, base textbox, base commandbutton, etc),...
2
by: Krzysztof Karnicki | last post by:
I would like develop Form on my Windows Application, that is going to notify the user, just like Microsoft Office 2003 shows that there are new mail coming. When I use System.Windows.Forms.Form and...
2
by: Timbo | last post by:
Hi there, I’m not used to working in VB and I think this situation calls for excactly that. I use Access 97 SR-2. My first table is a table containing all the Tickets I got. The field ”Ticket”...
0
by: Brian Tkatch | last post by:
Been trying to figure out how to show borderless forms indside an MDI Form, without showing the border at all. Given that (in our case) only one such form needs to show at a time, we were able...
15
missinglinq
by: missinglinq | last post by:
I'd like to use acCmdAppMinimize with two forms on the screen at once. Currently, if I have a form opening the db (with DoCmd.Maximize in the OnLoad event) and then a popup form on top of the first...
3
by: Torben Laursen | last post by:
I have a COM shared add-in written in C# that I use in Excel. One of the thinks that the user can do is to open some winforms. The problem that I have is that the first time the user opens a...
5
by: John Dann | last post by:
Something very simple that I can't spot how to do: I wand to display a msgbox showing some current configuration parameters when my VB2005 program starts up. However, I want the main form to...
6
by: painkiller | last post by:
language: vb.net environment: windows forms .net : v1.1 i am having a checkedlistbox control that display document category such as text, image, video, audio etc. these values are coming from...
7
by: =?Utf-8?B?TWF0dA==?= | last post by:
Hi I have an app that runs without a main form, just a notification icon, when the user clicks the icon the form is shown, and when the form is minimized it's hidden. This all works great,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...
0
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...

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.