473,382 Members | 1,657 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,382 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 1193
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.