Results 1 to 4 of 4

Thread: Returning to VB6, questions

  1. #1

    Thread Starter
    New Member Ninja pizza's Avatar
    Join Date
    Jul 2025
    Posts
    2

    Returning to VB6, questions

    It's been over 20 years since I used VB6. Please bear with me since I don't remember much. A simple project I'm going is to make a command prompt program. I have a textbox called txtCmd. Here's my code to resize everything in the form resize event:

    Code:
    txtCmd.Left = 10
    txtCmd.Width = Me.Width - 150
    txtCmd.Height = Me.Height - 1000
    It works, but is there a more elegant way? I found the right numbers to subtract through trial error, but the code isn't pretty. If I don't subtract anything, then the bottom and right edges are cut off. I also wanted to include at least a slim edge on the left side. How do you do it?

    I am sure I'll have more questions later. Is it alright if I append them as new posts, or should I edit the OP here to include them?

    Thanks

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,266

    Re: Returning to VB6, questions

    In the VB6 IDE, no not really. That's exactly how all my resizing code still works.

    With the same language as VB1-6... if you're not maintaining legacy code affected by a current bug or small incomplete feature, twinBASIC is the better option now. It's backwards compatible with VB6 and laid out much the same way, so all existing knowledge and learning materials apply, but you also have extensive new language features and modernizations that are like if Microsoft never switched to .NET and instead continued on the same path as VB1-6. Specifically for this, tB has a control anchoring and docking system, and multiframe control, that handles all basic sizing stuff like this with a few clicks. You'd just expand Anchors in the control properties pane and check the box for Right and Bottom to get the same effect as your posted code (your posted code would work as-is too, of course).

    I am sure I'll have more questions later. Is it alright if I append them as new posts, or should I edit the OP here to include them?
    If they're just quick simple things probably ok to add them here... if it's a more complicated question or nobody answers for a few days or a week, new post.

  3. #3

    Thread Starter
    New Member Ninja pizza's Avatar
    Join Date
    Jul 2025
    Posts
    2

    Re: Returning to VB6, questions

    Awesome, thanks. I'll check out tB. I program for VB6 in Windows XP on VirtualBox. I have my host computer dual-booted with Win10 and Mint Linux. I use Linux 99.99% of the time. I'll check to see if tB will run natively on Linux.

  4. #4
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,266

    Re: Returning to VB6, questions

    The exes it produces will run with WINE last I heard; whether the IDE will likely depends on whether WebView2 works, which requires some tweaking I think. XP is no problem for exes but definitely no WebView so no IDE; needs Win7+.

    Cross-platform compilation is a major goal of tB and Linux is definitely a target, so in the future you'll be able to reuse quite a bit of code and compile native binaries not needing WINE.

    I'd also note that even if you continue in VB6 itself... the VB6 IDE and the binaries it produces work fine on Windows 10/11. You need to follow special instructions explaining a couple minor extra steps to install the IDE, but it's not difficult and is what most people still using VB6 do; you don't need to develop in or only run your programs in a VM if you don't want to.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width