Re: Conversion Problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You are quite correct in saying i am not familiar enough with the framework and .NET. My problem seems to be i'm trying to do the same things in vb.net as i did in vb6 rather than taking the new approach to it. Frustrating never the less.

It would certainly assist if the help provided more practical examples. I suppose i should buy a book!

"Tom Shelton" <tom_shelton@xxxxxxxxxxxxxxxxxx> wrote in message news:3rmdnZmPI7VnFOvVnZ2dnUVZ_qXinZ2d@xxxxxxxxxxxxxx
On 2008-07-10, John <no-email-supplied@xxxxxxxxxxx> wrote:
glad to know its not just me, i would not even have considered using vb8 but
i do like the new updated appearance and i was worried that eventually vb6
would not work with microsofts operating system updates.

practically everything i try and do that took a few seconds in vb6 takes
hours in this to sort out and then like this example i have spent nearly the
whole day trying to achieve something that cannot be done simply (the best
solution being create a vb6 dll to handle it (says it all really doesn't
it). I have many more examples, no contol arrays so you have to build them
at run time and spend hours trying to get the layout correct, - printing -
you cannot easily specify a new page without going into a recursive print
handler which takes more time trying to handle your printing, etc etc all
simple stuff but a nightmare in this product.


LOL... The problem is John, that you are not familiar enough with the
framework and .NET. Once you become so, on the whole things are MUCH easier
then VB6. I know, I spent years doing VB work. I'm not claiming every thing
is easier, just most.

Your example of control arrays is pretty funny - I
don't even miss them. First off, the main reason in VB.CLASSIC for control
arrays was 1) common event handling and 2) avoiding the 256 unique control
names per form limit (or was it 255?). 2 doesn't apply in VB.NET and 1 is
handled by the fact that VB.NET events allow an event to be assigned to
multiple controls (heck, they don't even have to be the same type)...

' you can do this in the ide - just select all of the controls you want, go
' to the event tab in the properties window and add the handler - the ide will
' automatically add the handles list :)
Private Sub Button_Click (ByVal sender As Object, ByVal e As EventArgs) _
Handles Button1.Click, Button2.Click, Button3.Click

Dim clickedButton As Button = DirectCast (sender, Button)
' do button stuff
End Sub

There are times that using index's to access a control are helpful... And
even that is a fairly simple task.

Public Class MyForm
Inherits System.Windows.Forms.Form

Private buttons() As Button = new Button() {Button1, Button2, Button3}

...

Private Sub DoCoolStuff(ByVal btnIndex As Integer)
Dim theButton As Button = buttons(btnIndex)
' do cool stuff with the button
End Sub
End Class

Or you can index them from the containser controls collection at runtime by
the name:

Dim theButton As Button = DirectCast(Me.Controls("theButton"), Button)

There is no need to dynamically generate controls... You just have to
understand the differences and the capabilites of VB.NET and then you don't
have these types of issues (well, at least not as often).

As for your file issue, I only was half joking about your file access - the
fact is that .NET is a different target platform then VB6. VB6 targeted COM
and so it has a lot of COM'isms - such as SafeArrays - and so in some ways is
not compatable. Personally, if I were you I would create a VB6 component that
would be able to convert the files into a more .NET friendly format and then
access them using the System.IO namespace classes. The FileXXX VB.NET native
functions are crap...

--
Tom Shelton

.



Relevant Pages

  • Re: Conversion Problem
    ... ...and he's not familiar with the framework because the help system sucks like a hoover. ... Your example of control arrays is pretty funny - I ... VB6 targeted COM ... You can still buy legit copies of VS6, but be prepared to pay more than VS2008 costs... ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Conversion Problem
    ... That will take you to the help for that control, ... TextChanged event of a combobox and a textbox in VB6? ... pasting a block of text in anything resembling an immediate window... ... supported under Vista - it's the IDE's that aren't supported. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VB.NET 2008 not backward compatable?
    ... WPF has control templates and styles which offer ... a long hard slog with the API in VB6. ... Irony is you saying that Windows is COM centric and then blaming COM's bad ... VB can write a standard non-COM DLL. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: SendKeys cannot run inside this application
    ... from one control to another control) was not working. ... I have not touched VB6 in 5 years, so, take this for what it is worth. ... Make your .Net form a control, then host that in the vb6 form. ... It basically puts a windows message in a given progs message queue. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Conversion Problem
    ... i do like the new updated appearance and i was worried that eventually vb6 ... Your example of control arrays is pretty funny - I ... ' to the event tab in the properties window and add the handler - the ide will ... Dim theButton As Button = DirectCast, ...
    (microsoft.public.dotnet.languages.vb)