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

newB GUI library problems

I am very new to programming GUI VB.NET, and I just tried making a simple
Form popup with a button that says OK and a label that says "Hello world". I
have Visual Studio, but I am not familiar with the making a "Windows
Application". I would like to just program, using code, enough to make what
I mentioned above.

I started with:

Public Class Form1
Inherits System.Windows.Forms.Form

But the compiler said System.Windows.Forms.Form was not defined. How do I
start?

P.S.
I would like to create my first GUI program without the assistance of Visual
Studio's Windows Application maker.
Nov 21 '05 #1
8 1634
If I get the appropriate library that I have to import, then I am sure that
I can find the syntax to the name the label "Hello World" and the button
"OK". But I need the code the make the frame visible, to put the button on
the frame, and to put the label on the frame. Since I fully know Java, I
should be able to get the conceptual ideas of GUI ok, but I need the actual
syntax.

-Sorry for not including this in the original message.
If you would like to contact me personally (which I discourage), then remove
the x from my e-mail address.
Nov 21 '05 #2
you need to add this to the top of your code before your class form1

Imports System
Imports System.Windows.Forms

"Hari" <ha***********@yahoo.com> wrote in message
news:Bq********************@adelphia.com...
I am very new to programming GUI VB.NET, and I just tried making a simple
Form popup with a button that says OK and a label that says "Hello world".
I
have Visual Studio, but I am not familiar with the making a "Windows
Application". I would like to just program, using code, enough to make
what
I mentioned above.

I started with:

Public Class Form1
Inherits System.Windows.Forms.Form

But the compiler said System.Windows.Forms.Form was not defined. How do I
start?

P.S.
I would like to create my first GUI program without the assistance of
Visual
Studio's Windows Application maker.

Nov 21 '05 #3
When I added

Imports System
Imports System.Windows.Forms

to the my file I got the following errors in Command Prompt:
C:\hari\VB\GUI\Starting>vbc Form1.vb
Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322.573
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

error BC30466: Namespace or type 'Forms' f
or the Imports 'System.Windows.Forms' cannot be found.

Imports System.Windows.Forms
~~~~~~~~~~~~~~~~~~~~
error BC30002: Type 'System.Windows.Forms.
Form' is not defined.

Inherits System.Windows.Forms.Form
~~~~~~~~~~~~~~~~~~~~~~~~~
error BC30002: Type 'Form' is not defined.
Dim f1 As New Form()
~~~~
Nov 21 '05 #4
* "Hari" <ha***********@yahoo.com> scripsit:
I started with:

Public Class Form1
Inherits System.Windows.Forms.Form

But the compiler said System.Windows.Forms.Form was not defined. How do I
start?


Are you sure a reference to "System.Windows.Forms.dll" is set? If you
are using "vbc.exe" to compile your application, take a look at the '/r'
(or '/reference') option.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #5
> Are you sure a reference to >"System.Windows.Forms.dll" is set? If you
are using "vbc.exe" to compile your application, take a >look at the '/r'
(or '/reference') option.


I'm very new to VB.NET, so I'm not sure what exactly you mean. I typed in
vbc /r, but it told me I needed a file_list. How do I set a reference to
System.Windows.Forms.Form. I've run basic programs through which I print to
the console, which means I must have some libraries. But I'm not sure if I
need to download something from the net. Please help! Thanks.
Nov 21 '05 #6
* "Hari" <ha***********@yahoo.com> scripsit:
Are you sure a reference to >"System.Windows.Forms.dll" is set? If you
are using "vbc.exe" to compile your application, take a >look at the '/r'
(or '/reference') option.


I'm very new to VB.NET, so I'm not sure what exactly you mean. I typed in
vbc /r, but it told me I needed a file_list. How do I set a reference to
System.Windows.Forms.Form. I've run basic programs through which I print to
the console, which means I must have some libraries. But I'm not sure if I
need to download something from the net. Please help! Thanks.


The libraries are installed on your system if the .NET Framework is
installed. I assume that the Framework is installed if "vbc.exe" is
available. To add a reference, add something like
'/r:System.Windows.Forms.dll' to your command line.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #7
I downloaded the SDK for VB.Net (although i think I already had it) and then
typed in

vbc /r:System.Windows.Forms.dll

into the Command Prompt. I got an error reading:

vbc : Command line error BC2008 : no input sources specified.

Then I tried compiling the following source code:

Imports System
Imports System.Windows.Forms

Public Class Form1

Shared Sub Main
Dim f1 As New Form()
End Sub

End Class
I got the following errors:

error BC30466: Namespace or type 'Forms' for the Imports
'System.Windows.Forms' cannot be found.
Imports System.Windows.Forms
~~~~~~~~~~~~~~~~~~~~

error BC30002: Type 'Form' is not defined.
Dim f1 As New Form()
~~~~

I thought my entire stack of libraries was gone, but then when I tried to
compile the following code:

Imports System

Public Class Form1

Shared Sub Main
Console.WriteLine("Hello World")
End Sub

End Class
It compiled and ran perfectly. What have I done wrong? Do I need to change
the syntax of my code or download libraries? Is it that I am not compiling
my code correctly. Please reply soon. Thanks all- Hari.

P.S.
If you wish to reply to me personally (which I discourage), please remove
the x from my e-mail addresses as it only exists to prevent spam.
Nov 21 '05 #8
* "Hari" <ha***********@yahoo.com> scripsit:
vbc /r:System.Windows.Forms.dll


You'll have to specify the source files that should be compiled too.
Please post your complete command line to "vbc".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #9

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

Similar topics

4
by: Donald Newcomb | last post by:
I'm a real Python NEWB and am intrigued by some of Python's features, so I'm starting to write code to do some things to see how it works. So far I really like the lists and dictionaries since I...
11
by: The_Kingpin | last post by:
Hi all, I'm new to C programming and looking for some help. I have a homework project to do and could use every tips, advises, code sample and references I can get. Here's what I need to do....
1
by: HateSpam | last post by:
Total newb here. I've built a custom library called ClassLib1. I want to use the 3 classes I've got defined in there in a simple 1-form windows app. I added the reference to the .dll to the...
2
by: Andrew | last post by:
please explain this behavior to a newb:
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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?
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:
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
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...

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.