VFB IDE【Visual Freebasic】Like vb6@5.8.11//2023-7-6

User projects written in or related to FreeBASIC.
Post Reply
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2023-3-6

Post by xiaoyao »

VB6 How do I create copies of forms by name

Code: Select all

Dim NewForm1 As Form
Dim NewForm2 As Form2

Private Sub Command1_Click()
    Set NewForm1 = Forms.Add("Form1")
    NewForm1.Show
    NewForm1.Caption = "Form1 New Copy"
    
    Set NewForm2 = Forms.Add("Form2")
    NewForm2.Show
End Sub
IN VFB (Visual Freebasic ide)

Code: Select all

Sub Form1_Command1_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)   
   Me.Caption = "i'm Main Window"   
    Dim C As Class_Form
    C = FormsAdd("Form1")
    C.CAPTION = "A form created by a dynamic copy Form1"
    
   Dim D As Class_Form
    D = FormsAdd("Form2","A form created by a dynamic copy Form2")     
End Sub

Function FormsAdd Overload(ByVal FormName As String) As Class_Form
    'GetNewFormByName
     Return FormsAdd(FormName,"")
End Function
Function FormsAdd Overload(ByVal FormName As String, Title As String) As Class_Form
   Dim Class1  As Class_Form
   Select Case   FormName
      Case "Form1"
         Dim Form1Copy As Form1_Class_Form
         Form1Copy.show 0, False
         Class1= Form1Copy
         
      Case "Form2"
         Dim Form2Copy As Form2_Class_Form
         Form2Copy.show 0, False
         Class1= Form2Copy
   End Select
   If Title <> "" Then Class1.caption = Title   
   return Class1
End Function   
Last edited by xiaoyao on May 19, 2023 3:24, edited 1 time in total.
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2023-3-6

Post by xiaoyao »

vfb has not supported dynamic window creation, which is a pain in the heart.
I spent the morning deciphering his principles and unpublished methods.

The next step is how to create controls on the fly, creating arrays of controls on the fly, which can be very interesting, but also very difficult.
After all, an IDE was not developed by Microsoft, and the author was not interested in some of the features, so he had to make some magic changes himself.
What if it works? It'll get more and more interesting

This similar VB6 software is free, also have open source version, interested friends can send me an email, developed a new function, can be incorporated into the latest version.
Any bugs are welcome to point them out. Hopefully VB6 and tools like VB6 will keep us entertained for another 30 to 50 years.

Let the new UI style and more syntactic sugar work for us
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2023-3-6

Post by xiaoyao »

How do I create a New form in code
in vb6

Code: Select all

dim A as New form1
in Freebasic
The new copy of the form created is shared globally

'code put on first
Dim Shared PublicForm2As Form2_Class_Form


Sub Form1_Command2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
PublicForm2.show 0, False

Dim Form2Copy As Form2_Class_Form
Form2Copy.show 0, False
End Sub
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2023-3-6

Post by xiaoyao »

Makoto WATANABE wrote: May 17, 2023 22:13 I updated the Japanese Language files for VFB.
Thank you for your support and love of VFB. If you have the time and technical ability, we hope to add new features to the VFB IDE extension.
I completed a function to create a form dynamically in the morning, with very little code, but it took almost 4 hours.

If you deliberately miswrite a sentence in your code, the compiler will leave the original code, which you can open and study in its entirety.
Directory: Project path \release
= = = = = = = = = = = = = = = = = = = = = = = = = =
DECLARES.inc finds: Declare Function MsgBox Overload, which supports multiple overloads with different parameters
#include Once "Form\ClsForm.inc" loads the basic form class, where methods such as form1.caption come from

Type Form1_Class_Form Extends Class_Form, which is also a fun class

If you have 2 forms, you can add a new Form1B
Dim Shared Form1 As Form1_Class_Form
Dim Shared Form1B As Form1_Class_Form
Dim Shared Form2 As Form2_Class_Form

----------------------
Form1_FORM.inc file
Form1_Class_Form.Show, you can also add some new features
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2023-3-6

Post by xiaoyao »

HOW to New Button by Freebasic Code?
MY CODE IS RIGHT?

Code: Select all

Function NewControl(ByVal ControlClass As String, ControlName As String, Text As String,Left2 As Long,Top2 As Long ) As .hWnd 
'.hWnd  CHANGE TO  HWND
      Dim hWndControl As .hWnd 
      'Dim pWindow As CWindow Ptr = New CWindow("CWindowNew")     
      hWndControl = pWindow2->AddControl(ControlClass, Me.hWnd, 102, Text, Left2, Top2, 200, 30, WS_CHILD Or WS_CLIPSIBLINGS Or ES_LEFT Or WS_VISIBLE Or ES_AUTOHSCROLL Or WS_TABSTOP Or ES_WANTRETURN, WS_EX_CLIENTEDGE,, Cast(Any Ptr, @Form2_CODEPROCEDURE))
      Return hWndControl
 End Function

   Dim ObjHwnd As .hWnd, Button4 As Class_Button 

   ObjHwnd = NewControl("BUTTON", "ButtonX", "'new Button", 0, 0)
   Button4.hWnd =ObjHwnd
   MsgBox("Button4.Caption=" & Button4.Caption)
   Button4.Caption = "New Button XXX"
LIKE THIS:
vb6 adds controls dynamically
'

Code: Select all

Private Sub Form_Load()
Add: PICTURE1 control, button control
'
Example: Form1.Controls.Add "VB.CommandButton", "cmdObj1", Frame1
'
Dim NewText1 As TextBox
Set NewText1 = Me.Controls.Add("VB.Textbox", "Text1ABC", Picture1)
NewText1.Visible = True
'End Sub
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2023-3-6

Post by xiaoyao »

The new COM object wrapper makes it a little easier to use
by :驰骋乾坤

Code: Select all

    Dim excel as CObject = createobject("excel.application")
    dim Workbooks As CObject = excel.Get("Workbooks")
   Workbooks.Clear
   dim Workbooks As CObject = excel.Get("Workbooks")
   dim Workbook As CObject = Workbooks.Run("Add")
   Workbook.Run("saveas" ,"c:\1.xlsx")
   Workbook.Run("close")
   Workbooks.Clear
   Workbook.Clear
   excel.Run("quit")
   excel.Clear

      dim demo as CObject
      demo.CreateObject("Demo.DemoClass" , ,"Demo.dll.manifest")
      debug.Print demo.Run("Add" ,123 ,456).ToString
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2023-3-6

Post by xiaoyao »

It would be nice if you could consider redeveloping a new IDE in Freebasic or VB.NET. Because of the older version of VB6, only 32-bit programs can be generated and some new syntax support is missing. Such as multiline text, JSON strings, etc.

VB.NET as a background compiler, compatible with VB6 engineering or syntax, and then generate 64 - bit procedures, is a very interesting creative design
It also has access to.NET's extensive libraries and beautiful UI components. VB6 and VB.NET,JS code can be used at the same time programming.
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VFB IDE【Visual Freebasic】Like vb6@Updae2023-3-6

Post by xiaoyao »

new version 5.8.11
https://github.com/xiaoyaocode163/Visua ... r/DownLoad
https://github.com/xiaoyaocode163/Visua ... r/DownLoad

Found BUG not fixed:

5.8.11 2023-7-6
Fixed non-stop point search button, more than a few times, VFB must flash back.
Fixed an issue where the project attribute "Use version information" was not checked, but the version attribute would still be compiled
Fixed an issue where files in the "Other Files" area were affected when the editor scheme was set to a non-original format
Fixed an issue where the help area was not prompted when clicking on keywords
Fixed an issue where auto-complete code pairing would pair WITH and ENUM when they were followed by words
Fixed the issue of deleting items in VFB help on crash.
Fixed an issue where the YFTreeView control deleted an item without generating a deletion event for the item
Fixed an issue where shadows in VFB Windows would be added to the taskbar when a software installation restarted System Explorer, or shadows added by VFB-written software window properties (need to be recompiled).
Fixed a crash that occurred while compiling and automatically updating the case of the code.
Fixed an issue where breakpoints could not be hit when debugging 64-bit software.
Fixed an issue where the Yflist control, YFList1.ItemData(i)=xx was invalid
Improved to compile the module first, then compile the window, to avoid the problem of calling one after another, because the module is public and the window is private.
Improved Optimization Auto Correct case, no longer correct case when looking for a replacement and non-standard code and no space at the beginning of the auto correct.
Improved control properties set text is Chinese, compiled in the Chinese system, to the non-Chinese system will display garbled, now forced to use wide characters to save, so that Chinese can be displayed normally.
Improved Click on the EDIT control in the color editing window to cancel the unfocused window mode and type numbers.
Improved optimization code formatting comparison code, improve the speed of code execution (QQ: 1494575481 little brother, optimized)
Improved the EDIT control in the color selection window to type text
New module compilation order adjustment, entered in Project properties.
The template selection window is added.

5.8.10 2023-6-13
New Code Formatting module added shortcut key "Ctrl+Shift+G"
Fixed an issue where icon files placed in controls would not be displayed.
Fixed Inc/afx/AfxStr.inc 1445 line 1471 error in FB compiler version 1.10.
Fixed Ctrl+Shift+Z not being redone
Fixed when code prompts members, the right side always defaults to the description of the first item
Fixed search current project, searched for resources and non-text
Change the open project in the file menu to use a dialog box, which is more logical.
Change the compiler with version 1.10, requiring the old version to be downloaded in the VFB group.
Control updates, not included in the software:
Fixed YFbutton does not display the button color correctly when the mouse is released, causing no click display effect.
Improve YFscroll, YFList, YFTreeView YFproTab, YFswitcher, YFbunGroup, YFsplitBar use exclusive class name, is no longer the name of the class.

5.8.9 2023-5-1
Fixed closing the help page, the window name does not change, click the help button to switch help, the window name does not change
Fixed an issue where the project section of the menu was disabled after Help was enabled.
Fixed removing favorites or recent projects while removing other items.
Fixed selecting automatic login, but not showing your account information on the home page.
Fixed abnormal display when files were deleted from Favorites and Recent projects list
Fixed to add files, Windows and modules are not recognized, all treated as normal files.
Fixed incomplete display when parameter prompts in code tips.
Fixed code prompts showing incorrect position and size.
Fixed a missing DLL prompted by user actions in the VFB window
Fixed new projects sometimes not showing BAS project blank templates.
Fixed when debugging, the mouse was placed over the variable, indicating that the window size of the variable value was abnormal
Change the global default setting of fonts for window editing in Cancel Settings.
Change the font of the code prompt to adjust to the font and size of the code editor
Change "Need to compile" and "Remarks" in the right-click menu of deleted projects list
Change the "plug point mark" is not automatically added when opening BAS project. If necessary, after opening the file, right-click the menu, insert the project and select "BAS Project Insert point".
Add New project Enter the project name and press Enter to create a new project.
The new WIn7 and XP systems can be like WIN10 systems. Supports mouse wheel on what window, what window has wheel message. The old system was where the focus was, where the rollers were. This is true of both the VFB itself and the compiled software.
When adding mask code input, the shortcut key enters some non-display characters.
Added that code prompts are treated as constants for Enum members that do not have names. If there is a name, you need to type the name and prompt the member.

5.8.8 2023-3-21 Spring Equinox
Fixed an issue where there were decimal points after Then Else and formatting would merge
Fixed an issue in the With statement where the code did not prompt after common statements were dotted, such as "If."
Fixed an open temporary file that did not show the extension
Fixed an issue where the text of new Windows and modules was capitalized.
Fixed new TAB, kernel function names in the pop-up menu became garbled
Fixed The project list and tag were not updated correctly to the new name after the tag was saved as
Fixed a new button on the BAS project point TAB, there are 2 splits in the pop-up menu
Fixed switching theme color, code color was not updated immediately
Fixed TAB control binding a window with Chinese name will not take effect
Fixed YFproTab toggle clicking on the TAB, just above the Close button. Let go of the mouse and the TAB will close.
Fixed adding Windows and modules, closing the project and then opening the project, the new is not in the project
Fix only modified individual files in the project and the project label was not saved with * after saving.
Fixed when switching between window design and code editing, project changes were not marked and the state was not saved.
Fixed closing a project file tag that did not show an *
Fixed the bottom prompt area, no prompt auto save
Fixed When a control class is modified to use a new code library function, the compiled software Times function does not exist.
Fixed YFproTab control not showing new button after closing all tabs.
When the event function definition is wrong, VFB will automatically correct and prompt, and then there is a probability of a crash.
Fixed debugging EXE with Chinese name when the software could not be found
Fixed debugging BAS project could not drop breakpoint
Fixed when the project list accidentally produced the same file, but did not repeat when opening the project
Improved the default file name when adding a window, not the same as all files in the current project.
Improved project list and label names, unified names
Improved home page Add sorting function, when loading folders the mouse becomes hourglass, wait until the loading is finished can be operated.
When you modify a control name in an array of modified controls, you are prompted to select modify all or modify individually.
New non-text files are displayed in hexadecimal data, the plug-in supports opening files, and provides a plug-in to display images as an example.
New yfGDI adds the ability to switch whether GDI+ parameters are integer or not. When drawing some boxes and lines, the phenomenon of blurring occurs without rounding, and some places do not need to be rounded.
Post Reply