|
Daniel Turini wrote:
The IDE is the same for all languages in .NET.
The IDE is generally the same, but there are a few differences. The project properties are a bit different, plus other minor differences.
Daniel Turini wrote:
like only one namespace in each assembly (it's a property of the project)
VB supports namespaces the same as C#.
Namespace MyNamespace.MyNestedNamespace
Class A ' Full name: MyNamespace.MyNestedNamespace.A
End Class
End Namespace
Daniel Turini wrote:
no boolean shortcircuit evaluation
You don't get short circuit evaluation using And/Or, but if you use AndAlso/OrElse you get short circuit evaluation.
VB doesn't support:- indexers: a special property which allows you to access an instance of a class like an array, instead you get an Items property.
- operator overloading: Allowing a class to create new meanings for +, -, *, /, etc
- Optional parameters: Create and call methods without any value being provided. As you'll see below it is supported but with a twist.
- unsigned types: This isn't too important because unsigned types are not compliant with the CLR anyway, they are provided for conveinence.
VB does support:- Late binding: Calling methods on an object without having to know what type the object is, just that it supports that particular method signature.
- Optional parameters with default values: Just like C++ you don't have to provide values if you just want the default value. The default value is required, unlike VB6.
- Handles keyword: Events can be wired up at compile time without needing to use
myEvent += ..... , though if someone wants they can use the VB equivalent, AddHandler . Coming from using VB for all my real programming projects I naturally wanted to use VB.NET, but there were enough minor things that irked me into using C# instead.
First, I prefer curly braces over Then, End *, etc. Second, I really did not like the addition of the short circuit keywords, I would have rather had And/Or do it. Third, I prefer curly braces . Fourth, I did not care for using keywords like Shadows
Aside from those differences there isn't a whole lot of difference between C# and VB.NET, 90% of your code is going to be using the .NET base class libraries so that is where a lot of the knowledge is going to be.
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
Optional parameters: Create and call methods without any value being provided
But because of overloading, it can be done with two different methods, just leave out one parameter
James T. Johnson wrote:
Handles keyword: Events can be wired up at compile time without needing to use myEvent += ....., though if someone wants they can use the VB equivalent, AddHandler.
And how could anybody want to use anything else! In all of my C# code, whenever I accidently create an event handler I dont want, I think "oh damn" and delete the method. Then, come build time, bring on the errors, as the code, miles up in the file, hidden in the GUI created #region, mentions these missing methods.
(I seem to be just replying to you and ranting these days... you must have a friendly face )
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Programming background is absolutely one of the things that will sway a decision, and it also sways the arguments. I agree with most of what you have said, and James mentioned about the short-circuiting.
You did mention that the IDE is the same, and I have found this to be not true, and the areas that are different are annoying. I only find these annoying because of my background in VB though, and because of where I am used to finding things.
For example, the two drop-downs at the top of a code window in VB work as they did in VB6, and I find this very useful. Whenever I start up a C# project, I always fumble around for a little while trying to remember how to get it to insert the method signitures of any interfaces I am implementing.
There is also things like reformating of code (automatic indenting for example). I find that VB does this at every stage, whereas C# doesnt. I like it, but I can see it would be enough to annoy people.
Related to that, the error checking that is done in VB is realtime, so as you type. In C# it happens at build time.
Now these points, it is obvious that I come from, and like, VB. It is easy to see how these features would irk a C# or C++ programmer, but there are enough of them (i feel) to make it an issue when deciding.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Craig Kazial wrote:
why is it looking a bit un-represented?
#1 reason is that this is mainly a C++ development site, and many of the coders who are using .NET are doing so with managed C++ and C#.
In my reply to Daniel I list some of the differences between VB.NET and C# and my reasons for choosing C# over VB.NET.
In the end you have to make up your mind which language to follow, but I can almost guarantee that the MS VB MVPs will not let them drop VB anytime soon I would recommend learning a bit of C# for two reasons, to see which one you like, and so you can make use of 75% of the sample code out on the web.
James
Simplicity Rules!
|
|
|
|
|
How can I disable to control buttons(minimize, maximize/restore, close) on a MDI parent form?
|
|
|
|
|
In the object insepector you can set MaxButton / MinButton to True/False. If you set them both to false, they disappear - not disabiled.
Dylan Kenneally
London, UK
|
|
|
|
|
Object inspector? I am thinking you are refering to the property listings and that it does not have max/min properties to set, it has those on the child or normal forms but I do not have them for the mdi form. If you are refering to something else, please let me know, because I haven't heard of the object inspector before. thx again.
|
|
|
|
|
Oops, sorry, I was thinking of the MDI child. (Object inspector is the property listings yes, I'm from a Delphi background where its called an Object Inspector)
My mistake, sorry
Dylan Kenneally
London, UK
|
|
|
|
|
Hello
I try to run remote WSH script (sample from MSDN):
var oController = new ActiveXObject("WSHController");
var oProcess = oController.CreateScript("c:\\wsh5.6\\beenhere.wsf", "remmachine");
but have the error on all comp when i test it.
"..can't create activex object.." on second line ( "CreateScript" )
why is it?
Thanks
Ernst Maurer
|
|
|
|
|
Hello to everyone!
I have a project to do in VB. My problem is, that this program is divided to 2 purposes - 1-operator's entry form of some data, 2-displaying this data in another form in a second display (both displays are connected to 1 comuter). How can I display 2 different forms running at the same time in one program?
Thank you all in advance.
|
|
|
|
|
If you want to create a second window, or form, then you will need to do something like this.
' Declare the form variable
Dim secondForm as Form1
' Create the form object
Set secondForm = New Form1
' Set the form to visible.
secondForm.Show
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I am making a kind of monitor programme in visual basic 6.0
When i say monitor i mean it does things like tell you if someone is trying to phone you / dial up to the internet/ detect internet connection e.t.c
It is going well but i have several questions.
1 Is there a command for monitoring your telephone line so when someone calls you - visual basic does something like put a message box saying " you are being called by ..... "
2 On msn messenger whenever you get a new email it brings up a messaeg telling you. Is this possible in vb?
3 is there a command to launch dial up so you can connect to the internet?
4 Has anyone got a copy of anonymous mailer because the link doesn't work in the download section.
AND 5 I WANT TO MAKE AN INSTANT ADVERT REMOVER For my programme. So how do i write some code to see what windows internet explorer has open and close ones if their address is such and such.
Thanks to anyone who helps!
zeusra2
|
|
|
|
|
How can I know the length of an dynamic array in VB?
For example:
a = split(s,"|")
a.length???
|
|
|
|
|
UBound(a) + 1
If you could kick in the pants the fellow responsible for most of your troubles, you wouldn't be able to sit down for six months. - Unknown
|
|
|
|
|
I write a DLL, in that i create a Word application object for open a Word document. In VB app, it works well. But when i use that DLL in an ASP project. It doesn't work. How can i do that? Use Web service?
I want to write a Web application like Mail Merge in VB. Give me some idea to write it for the Web. Thanks a lot!
|
|
|
|
|
how I get all contents of a word doc wirh a macro written in VB ? after this I need to get it and put into a Rich Text field into another application using API !
|
|
|
|
|
use the clipboard anc copy it to that
|
|
|
|
|
use the document's select or range object and select the lot (or wotever part of the doc u want)
and use copy, its in the clipboard now
so get your app to paste
bryce
|
|
|
|
|
hi bryce !
I use
ActiveDocument.Select
Selection.Copy
and if I open a new doc and use Paste the content will copy !
but I need to copy this into a variable as :
doc.Body= "content"
How can I made this ?
thanks again !
|
|
|
|
|
Hi
I load a picture (bmp) into a picture control.
The picture control have AutoSize on true and the picture is bigger then the screen.
I need to check the color of every pixel.
With picture.point (x,y) I have access only to the region on the screen (otherwise return -1)
How can I check the color of all pixels?
Thanks
|
|
|
|
|
make picture1.AutoRedraw=True
this worked but the problem is that autoredraw property consumes alot of memory I think.
|
|
|
|
|
[VB6]
Anybody know of a way to create a new instance of a form if you only know the name of the form?
Right now i'm doing a huge hack... a big select case statement.
there has to be a better way!?!?!
|
|
|
|
|
Could you give us a better idea of what you are doing exactly. There are ways to create new forms programmatically.
Nick Parker
|
|
|
|
|
aight, here's the deal...
on the left, I have a treeview that holds a bunch of nodes which represent forms to open. They hold the name of the form as a string as their key.
when somebody clicks on a node, it should open a new instance of the form, by name.
If there is a better overall way to do the same effect, that'd be fine as well.
The basic gist of what I want is a list of the form's which can be shown, and to make a new one when the user clicks on it. It is possible to open more than one of the same form at a time.
|
|
|
|
|
Dim myForm as Form<br />
Set myForm = new Forms("MyFormName")
I've seen something similar to that, but I don't have VB 6 installed so I can't check it.
Should give you a start anyway,
James
Simplicity Rules!
|
|
|
|