473,395 Members | 2,192 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,395 software developers and data experts.

Create my own window

Until now I have been using the default "windows application" template to
create a new window. What I would like to do is play with dynamic window
creation. However, when I just create a class that contains sub Main() it
doesn't want to compile in the IDE. Is there some property I need to set?
The code below is what I want to use to create my window class. How can I
do it within the VisualStudio IDE?
Thanks,
Gary O.

Public Shared Sub Main()

Dim form1 As New Form

Dim form2 As New Form

form1.Text = "Form passed to Run()"

form2.Text = "Second form"

form2.Show()

Application.Run(form1)

MessageBox.Show("Application.Run() has returned " & _

"control back to Main. Bye, Bye!", "Two Forms")

End Sub
Nov 20 '05 #1
2 1902
"Gary Owsiany" <ga*****@swbell.net> schrieb
Until now I have been using the default "windows application"
template to create a new window. What I would like to do is play
with dynamic window creation. However, when I just create a class
that contains sub Main() it doesn't want to compile in the IDE.
Why? Error message? Which project type did you choose (Windowsapplication,
consoleapplicatoin or classlibrary)?
Is
there some property I need to set? The code below is what I want to
use to create my window class. How can I do it within the
VisualStudio IDE? Thanks,
Gary O.

Public Shared Sub Main()

Dim form1 As New Form

Dim form2 As New Form

form1.Text = "Form passed to Run()"

form2.Text = "Second form"

form2.Show()

Application.Run(form1)

MessageBox.Show("Application.Run() has returned " & _

"control back to Main. Bye, Bye!", "Two Forms")

End Sub


The code looks fine. What did you choose as the startup object in the
project properties?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* "Gary Owsiany" <ga*****@swbell.net> scripsit:
Until now I have been using the default "windows application" template to
create a new window. What I would like to do is play with dynamic window
creation. However, when I just create a class that contains sub Main() it
doesn't want to compile in the IDE. Is there some property I need to set?
The code below is what I want to use to create my window class. How can I
do it within the VisualStudio IDE?
\\\
Public Class AppMain
///
Public Shared Sub Main()

Dim form1 As New Form

Dim form2 As New Form

form1.Text = "Form passed to Run()"

form2.Text = "Second form"

form2.Show()

Application.Run(form1)

MessageBox.Show("Application.Run() has returned " & _

"control back to Main. Bye, Bye!", "Two Forms")

End Sub


\\\
End Class
///

In the project properties dialog set 'AppMain' as startup object.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3

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

Similar topics

6
by: mmac | last post by:
I am trying to create something like this: Response.Write "<a href=""javascript:openWindow('www.domain.com/events/EventDetails.asp?EventID=" & rsEvents("OccID") &...
3
by: jojowebdev | last post by:
Picking up from Friday.. I am still having trouble creating the Select Menu option. I got parts of the correct syntax but it is still not creating the selected carrier as an option in the parent...
8
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1:...
0
by: Husey | last post by:
Hi, I am trying to create a very simple EJB project which requires me to create a new jboss configuration in Eclipse. I keep getting the error message "An error has occurred. See error log for...
4
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my...
3
by: sanghavi | last post by:
how to create a set up project in vb.net..how to run an application on a different machine
4
by: =?Utf-8?B?QmVubnk=?= | last post by:
How do I create a new IE window (client script or ASP.NET server code) so that it will create a new ASP session with each new window? Thanks.
2
by: =?Utf-8?B?S2Vsdmlu?= | last post by:
Hi all, I am trying to create a new window (without border, title bar..etc) for using brush to make the whole screen become red. So, anyone knows how to create a new window after pressing a...
0
by: =?Utf-8?B?QmFydE1hbg==?= | last post by:
Greetings, To begin with we have an archetecture which has a manager Asssembly which loads "Plug-in" assemblies using reflection, when a the UI prompts the manager. This loading of the...
0
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.