What replaced the LOAD command in Visual Basic 6?

VB6 died with XP. I'm trying to re-write a VB6 app in Visual Studio Community. The VB6 project used the LOAD and UNLOAD commands to create and delete copies of text boxes on the form. How do I accomplish that with the latest version of Visual Basic under
Visual Studio?
Thanks,
VBhobbist
VBHobbyist

Frank,
[snip]
I'm sure it can be done, but how can I learn without coming back to this forum with every little question?
[snip]
Hey, I will gladly be here for any questions.
Public Class Form1
'the new .NET manual is online now:
' - go to https://google.com
' - type 'msdn [keyword]' (i.e: 'msdn list')
' - the first result is almost what is desired
' - if not enough information is given that is what the forumns are for!
'declaring array for textbox
' also note that -1 is the size, this is desirable so that textBoxes is initialized as an empty array so that when properties such as '.length' is used an exception wont be thrown saying the array is nothing
' note that some people prefer List(Of T) T means any type -> List is one of the most useful things in .NET and HIGHLY optimized. I did not use it here because it is an entirely new concept
' to learn more about list: http://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx
Private textBoxes(-1) As TextBox
Private Sub setupTextBoxes()
'setup the amount of textboxes you want
ReDim textBoxes(14)
'initialize an integer and loop thru the length of the array
For delta As Integer = 0 To textBoxes.Length - 1
'set current array position to a new object (note that the [TextBox class].New function will be called)
textBoxes(delta) = New TextBox()
'setup gui properties, note that as you are coding, the type will show up
' also note that when coding:
' x = New [type]
' it is similar to
' x = 0
' ^New Integer/String/Double/etc.
textBoxes(delta).Size = New Size(100, 21)
textBoxes(delta).Location = New Point(1, delta * 21)
textBoxes(delta).Visible = True
'note that all form objects that have a container can hold other form objects
' we add to the form
Me.Controls.Add(textBoxes(delta))
Next delta
End Sub
Private Sub getTextBoxStuff()
'note that all variables can be initialized uppon declaration
Dim strAllTextBoxes As String = ""
'initialize an integer and loop thru the length of the array
For delta As Integer = 0 To textBoxes.Length - 1
'note that there are new operators (+=, -=, &=, etc.)
'also, controlchars is the new way to use certain chars, and messagebox.show is the new msgbox
strAllTextBoxes &= "TextBox " & delta.ToString & " = '" & textBoxes(delta).Text & "'" & ControlChars.CrLf
'note: there are way more ways to concatenate strings now, for production you can benchmark each one for different purposes
Next delta
MessageBox.Show(strAllTextBoxes, "Form1", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load '< Note that this is how subs are linked to gui elements now with the 'Handles' keyword
'define a new button
Dim btnGather As New Button
'setup gui properties
btnGather.Size = New Size(100, 21)
btnGather.Location = New Point(110, 0)
btnGather.Text = "Click Me"
'add control to form, note that anywhere else, the button can be gathered again thru Me.Controls()
Me.Controls.Add(btnGather)
'add a handler, note that when typeing this, you can see what parameter types the handler needs
AddHandler btnGather.Click, AddressOf btnGather_Click
setupTextBoxes()
End Sub
Private Sub btnGather_Click(ByVal sender As Object, ByVal e As EventArgs)
getTextBoxStuff()
End Sub
End Class
Create a new Windows Form project and paste this, press play.
Enjoy.
EDIT:
If you post blocks of code here, I will personally convert it to .NET, although I highly recommend a creating new project when converting from VB6. If you post your entire project and it's not too big I will convert the entire thing (any complex concepts
will have to have provided comments).
If your project is not secure or personal you can copy it to your online cloud OneDrive and I can download the whole thing from there - let me know.

Similar Messages

  • What is the Java equivalent of Visual BAsic ASC() and MID() functions

    Hello all! I just would like to ask if you have any idea on how to convert the VB ASC() and MID() functions into java. Where:
    1. ASC( ) Function - Returns the ANSI value for the leftmost character in a character expression.
    2. MID() Function - The Mid method extracts a substring of length nCount characters from a CHString string, starting at position nFirst (zero-based). The method returns a copy of the extracted substring.
    I would really appreciate your help. Thanx!

    ah yeah! sorry typo error. see, I am converting a VB method that encrypts password:
    Function EncryptText(ByVal stDecryptedText As String)
    Dim stText As String, lngCounter As Long
    Dim iTemp As Integer, lngNumber As Long
    lngCounter = 1
    lngNumber = 8
    Do Until lngCounter = Len(stDecryptedText) + 1
    iTemp = Asc(Mid(stDecryptedText, lngCounter, 1))
    If lngCounter Mod 2 = 0 Then
    iTemp = iTemp - lngNumber
    Else
    iTemp = iTemp + lngNumber
    End If
    iTemp = iTemp Xor (10 - lngNumber)
    stText = stText & Chr$(iTemp)
    lngCounter = lngCounter + 1
    Loop
    EncryptText = stText
    End Function
    I converted this function into this:
    public static String encryptPass(String password) {
    String encpwd = "";
    int iTemp = 0;
    final int lngNumber = 8;
    String stText = "";
    for ( int i = 0; i < password.length() ; i++ ) {
         iTemp = Character.getNumericValue(password.charAt(i));
         if ( i % 2 == 0 ) {
         iTemp = iTemp - lngNumber;
         } else {
         iTemp = iTemp + lngNumber;
         iTemp = iTemp ^ (10 - lngNumber);
         char c = Character.forDigit(iTemp,Character.MAX_RADIX);
         encpwd = encpwd + String.valueOf(c);
         return encpwd;
    But I'm having trouble with the encryption because it returns a different set of characters. Did I convert it right? thanx.

  • Is X-windows and GUI desktops supported on the ODA "engineered system" running a RAC database?  If it is, what is the yum command needed to install the X-windows, Gnome, and KDE package groups?

    Is X-windows and GUI desktops supported on the ODA "engineered system" running a RAC database?  If it is, what is the yum command needed to install the X-windows, Gnome, and KDE package groups?

    While I agree with the direction of the suggestions with installing packages for X-windows, we do not have a blanket 'apply any package' recommendation.
    In particular we do not support altering the kernel (although we do have exceptions which we review on a case by case basis).
    Basically, if the you want to alter functionality that would not impact core functionality you are usually fine.
    A good guideling is : The more dependencies that there are between the package / rpm you are considering using the higher the potential impact on functionality - meaning higher chance for problems
    Note: We do use VNC including Real and Tiger regularly , but we have no hard recommendation on how you may want to use X-windows. I have never seen a limitation other than comments on bugs
    or incompatibility within the X-window product itself with certain kernel levels.
    Patching may overwrite some packages that you may install, however,  _depending on packages/rpms added_ there is also the possibility that you will break existing functionality to the point
    that patching itself will fail ( we have already seen a few cases of this in which case the proper mitigation is to remove / roll-back any alterations to the ODA before patching, and then adding the packages/rpms
    back after the patching is completed.
    From what you are discussing the impact should be low without conflicts, but please consider the above, and if you have specific packages which you consider potential problems
    please create an SR so that we can review packages / rpms on an individual basis.
    Once again: the main criteria for not supporting rpms is regarding the kernel itself
    Chuck

  • What is the key command to open Audition in Logic 8?

    The little play icon in the bin, sample editor, etc.
    The one for auditioning things.
    Doesn't work for me. The only way I can get, for example, a playback from cursor position in the sample editor--is to manually click on the little green play icon with the mouse. Same with the bin, loops, and so on.
    For many years I've had key commands to do this kind of thing, but it is broken for me since Logic 8. What is the key command for this called? I've tried disabling the space bar as a key command, and I've also tried re-enabling it for "play or stop". Although in the latter case, that should still function the way it does in the arrange window.
    Actually, I've tried a lot of things and I'm completely out of ideas.
    I posted on this subject several months ago and it remains unresolved. For the life of me I cannot get the audition button to work via any key command.
    Help?
    TIA
    Message was edited by: danseq

    Hi
    If you imported your key commands from version 7 there can be problems in version 8.
    Try using one of the key command presets from version 8.
    HTH
    CCT

  • What's the best way to create basic scrolling up end credits

    What's the best way to create basic scrolling up end credits with FCE. I want create normal look after the film that has a gap between the working title and the name (center-aligned, two-column
    scrolls)
    In the FCE Manual there was a good way to to do it with an asterisk (*) between the the words, but problem occurs when I had an umlaut (ÄÖ) in the word. The asterisk becomes visible and as many umlauts in the working title so many letters missing from the beginning of the name. I'm from Finland and we have lots of umlauts. So is there any other way to do this with FCE.

    You can use Title Crawl in Boris to do this. You set it up like a word processor with a right aligned tab, a gap and then a left aligned tab. Double click in the ruler to create a tab stop. Double click it again to change its alignment. You use the tab key to move between the stops. It's kind of hard to explain, but if you play with it, I think you'll get it.
    There is also Boris documentation on the install disc which will explain it more fully.
    Message was edited by: Tom Wolsky

  • What is the powershell command to get the user count in Active Directory

    What is the powershell command to get the user count in Active Directory

    Get-ADuser
    REF: http://blogs.technet.com/b/heyscriptingguy/archive/2012/10/30/powertip-single-line-powershell-command-to-list-all-users-in-an-ou.aspx
    This post is provided AS IS with no warranties or guarantees, and confers no rights.
    ~~~
    Questo post non fornisce garanzie e non conferisce diritti

  • What is the terminal command to list USB devices?

    In Ubuntu Linux the command lsusb lists all devices connected to the usb ports. What is the equivalent command in OS-X? Thanks.

    Linc:
    Thanks. The new thread, if you want to comment on it is:
    Activate/Deactivate USB connected device
    If I am able to deactivate or unattach or disable the driver that is responsible for controlling the usb web cam that I have in my Mac mini, the virtualization program (VBox) would be able to capture it (already configured with the appropriate filter) for my guest OS. Now, I only get a message saying that the camera is busy from a previous request.
    When I run your command, I get no response.

  • What replaces the magic extractor in  PS Elements 12?

    What replaces the magic extractor in PS Elements 12?

    This is adobe's suggestion, from this page:
    http://forums.adobe.com/thread/1302663?tstart=0
    The Magic Extractor ToolAlternative: Use the Quick select tool together with the Refine Edge tool to quickly select and extract anything from your photos.

  • I just got iTunes 11.0. I'm used to being able to return to the beginning of a song by hitting 'enter'. What's the new command for skipping to the head of a song?

    I just got iTunes 11.0. From all the previous versions I'm used to being able to return to the beginning of a song by hitting 'enter'. What's the new command for skipping to the head of a song?

    Mmmmmm. Works OK for me. I've tried every variation I can think of. Play from playlist, play from library, shuffle on, shuffle off, single song repeat on/off, playlist repeat on/off.
    WAIT !!   Now I've found it  !!  It happens when I have the sidebar hidden and play a playlist from the PLAYLIST pane. Hitting Enter then takes me to the FIRST song in the playlist.
    WAIT AGAIN !!! In the time it took to write the above, it changed again and works properly. Well properly is not really true. It works if I stay in the PLAYLIST pane. If I switch to the SONGS, ALBUMS or ARTISTS pane, enter does nothing. BUT, if I switch to the GENRES pane, enter starts the first song there. AND, if I've switched away from the PLAYLIST pane and switch back, enter then starts the first song in the playlist.
    WOW !! That was a crazy ride. I think we can safely say that there is something awry.

  • Tcp/ip ni-visa commands using visual basic

    what are the dll and bas files i need to communicate with a device via rj45 cable thru visbual basic , i can communicate when i use hyperterminal but i can't via visual basic
    tcpip::192.168.48.11:: this is where i'm stuck
    Solved!
    Go to Solution.

    hi,
    thanks i found that file. we recently purchased a gpib to usb and i used the call commands and everything worked out fine via visual basic i was able to talk to the device and everything.
    but i'm still stuck on how to connect to the device via ethernet cable. my address is 192.168.48.11
    so the way i have to write is  viWrite&(ByVal vi&, ByVal buf$, ByVal count&, retCount&) 
    i have no clue what all that stuff means this is how far i got what do i put after the ipaddress?
    viWrite&(tcpip::192.168.48.11
    do you guys have examples for this, if i can't figure it out can we pay national instruments for a software engineer to help us write a program,

  • What is the default port on visual administrator with 2004s

    Hi
    I just finished the install of Netweaver 2004s and oracle is up and running and the j2ee engine as well.
    I want to lauch the visual administrator but unable to connect
    its saying cannont connect to ip and port....
    What is the default port for the first time login
    Also,
    went threw my web browser was able to access the portal page of the Netweaver... I tried the sap* user name but doesn't work
    JF

    Hi Jean
    The default port for VA is 5XX04 (where XX is the instance number)
    the user for the portal is Administrator (not sap*) and the password is the one you used on the installation.
    Hope this help
    Juan
    Please reward with points if helpful

  • What is the touchless command to open a mobile hotspot?

    According to Verizon's description:
    When powered on, the Verizon–exclusive Droid Maxx is always ready for touchless control–even when it’s asleep. Need to open a mobile hotspot or get GPS directions? Accomplish it all with simple voice commands and without touching your phone (great for when your Droid Maxx is just out of reach).
    So... If I say "open mobile hotspot" it opens the menu but does not launch the hotspot itself. Meaning I have to get up and walk over to start it. What is the command that allows me to actually open a hotspot from across the room?

    I definitely appreciate the tip, that helped the voice recognition from far away and in noisy environments. However, when I say "open mobile hotspot" it still only opens the menu and you have to walk over to the phone and touch it to check the box that activates the hotspot.
    I spoke with a Motorola rep yesterday and they confirmed that the touchless controls will open the app, but will not start the hotspot within the app once it is open. So essentially Verizon exaggerated when they told us we could "open a mobile hotspot from across the room" as it does require you to touch the phone to completely open it.
    I love the phone AND Verizon, but it is irritating to get a new phone and discover that it is incapable of one of the main things it is advertised to be able to do.
    Sent from my Verizon Wireless 4G LTE DROID

  • How can I get the version of the GPIB driver from Visual Basic ?

    I want to readout from visual Basic which version of GPIB-Driver is installed on the PC. I must change some parameters for my application when GPIB 2.0 runs instead of 1.7.
    Thanks for any solution...

    Hi,
    The driver should create a key in registry depending on the driver version. Check for the existance of HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\NI-488.2M\ (In my case I had a folder called 2.00).
    Hope this helps out.
    Best Regards,
    Aaron K.
    Application Engineer
    National Instruments

  • What is the terminal command to open sound preferences in Mac Snow Leopard

    Hi
    I want to know what is the command to open sound preferences dialog from command prompt.
    short key for doing this is option key + F12. But I am looking for somehting I can enter in terminal to open sound preferences.

    Get under the hood with Command Line and the Terminal. Unix forum is here for fast answer:
    http://discussions.apple.com/forum.jspa?forumID=735

  • What does the /O command in combination with images?

    When I use Acrobat 8 to print scanned images to a postscript file an additional images is generated in the postscript file. Dependent on the value (1 or 2) behind the "/O" command this image appears in the pdf after I distilled the postscript with Distiller 8. Does anyone know what this "/O" command does or I can manipulate it with a setting in Acrobat 8?
    Thanks in advance.

    /O isn't a command. It's a normal name. Some procedure somewhere is
    called which will (presumably) look for this name and process it. So
    you need to read the procedure, rather than look for PostScript
    definitions.
    Aandi Inston

Maybe you are looking for