473,322 Members | 1,403 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,322 software developers and data experts.

where to put main in windows app

I have an app that consists only of a windows form. I used
the designer to create the form, then added some code.
But... I don't understand where to put the code. Where do
I put main so that the form can access the variables from
main? If I want to declare a new class type, where do I
put that? Right now, all of my code is within "Public
Class Form45"

Thanks
Jul 21 '05 #1
3 1191
If you declare your variable within namespace.class then your variable
will be seen by your form. And if you read your code (created by the
designer), you'll understand that creating new form is instantiate and
object.

You can start by reading various OOP books.

Regards,

Riwut

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #2
If you declare your variable within namespace.class then your variable
will be seen by your form. And if you read your code (created by the
designer), you'll understand that creating new form is instantiate and
object.

You can start by reading various OOP books.

Regards,

Riwut

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
create a new project of type "Windows application". VS will create a form
and will add the main code to it. If you start with a project of another
type (like class library) and add the form, you won't get the main routine.

That's probably the easiest way.

--- Nick

"Newbie" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
I have an app that consists only of a windows form. I used
the designer to create the form, then added some code.
But... I don't understand where to put the code. Where do
I put main so that the form can access the variables from
main? If I want to declare a new class type, where do I
put that? Right now, all of my code is within "Public
Class Form45"

Thanks

Jul 21 '05 #4

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

Similar topics

1
by: Pierre Rouleau | last post by:
I can't remember where/how sys.path is set (aside from the automatically loaded site.py) and i get a strange entry in it. Can anyone remind me where/how to control sys.path on a Win32 machine (i'm...
7
by: Microsoft | last post by:
I'm not sure where to physically place my subroutines in vb.net I get namespace and not declared errors... Imports System Imports System.Management Public Class Form1
2
by: Newbie | last post by:
I have an app that consists only of a windows form. I used the designer to create the form, then added some code. But... I don't understand where to put the code. Where do I put main so that the...
9
by: DanielJohnson | last post by:
I am wondering where does the value returned by main goes. Suppoes main returns some number say 42, where is it stored. Supposed a shell script call a C program and the program returns the value...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.