github VBAndCs/sVB-Small-Visual-Basic v2.4
Small Visual Basic v2.4

latest releases: v2.8, v2.7, v2.6...
23 months ago

What's new in sVB v2.4:

  1. The toolbox now contains a CheckBox control.
    Note that the Checked property is a tri-state property, as it accepts 3 valid values:
  • True: to check the box.
  • False: to uncheck the box.
  • empty string "": to dim the box to indicate an indeterminate state.
    You can also allow the user to switch by these tri-states while he is clicking the checkbox, by setting the AllowTriState property to True, but this property doesn't affect your ability to set the indeterminate state from code at anytime.
    For more info, see the CheckBox Sample app in the samples folders.
  1. The toolbox now contains a RadioButton control.
    Radio buttons work in groups. Buttons belong to the same group can have only one button selected at a time, so, you can have many groups on the form to let the user choose between deferent sets of options.
    You can combine some radio buttons into one group by setting the GroupName property of each of then to the same name like Group1. Or as an easier alternative, you can use the Form Designer to group radio buttons by selecting them, right-click, and click the Group command from the context menu. This will combine the radio buttons into one border so you can drag them together, and also will set the GroupName property of each of the to the same name, so they work as a group.
    For more info, see the Radio Button sample app in the samples folders.

  2. Label, Button, TextBox, CheckBox and RadioButton controls got an Underlined property, that you can set to True to draw a line under the text displayed in these controls.

  3. You can now use the Append methods to add a formatted text to the Label. These methods are:

  • Append: Adds a normal text to the end of the label text. This text will be formatted according the properties of the label like BackColor, ForeColor, Underlined and other Font properties.
  • AppendLine: Similar the Append method, but it adds a new line after the text.
  • AppendBold: Appends a text to the label with a bold font.
  • AppendItalic: Appends a text to the label with an italic font.
  • AppendBoldItalic: Appends text to the label with a bold and italic font.
  • AppendUnderlined: Appends a text to the label with a line drawn under it.
  • AppendWithFontEffects: Allows to control the Bold, Italic, underline effects of the appended text, by sending True, False or "" to the corresponding parameters. Not that sending empty string means using the original label property to set this effect. For example, if you send "" to the isBold parameter, the value Label.FontBold property will be used to draw the text. Ex:
Label1.AppendWithFontEffects(
    "Hello", 
    "",              ' ignore isBold param and use that of the label
    True,         ' isItalic = True
    False         ' isUnderLined = False
)
  • You can control the Font name and size by calling the AppendWithFontName, AppendWithFontSize or AppendWithFontNameAndSize methods. Note that sending "" to font name or size will draw the text with the original label properties.

  • The AppendWithFont methods allows you to set font name, size, and effects together.

  • You can control the fore and back colors by calling the AppendWithForecolor, AppendWithBackcolor or AppendWithColors methods. Note that sending "" as the fore color or the back color will draw the text with the original label properties.

  • You can also append a hyper link to the label, by calling the AppendLink, AppendBoldLink, AppendItalicLink or AppendBoldItalicLink, passing to the text of the link and a url to navigate to when the user clicks it. You can supply a local folder or file path or an IP address for the url parameter. When the user clicks the link, the folder or the file will be oppened (using the default program for this type of files) and the IP address will be navigated to in the default browsr on the user PC. If url is bad of file is not found, a blank page will be opened in the browser.

  • The AppendFormatted method combines all the above method. It can add a formatted text, or a formatted link if you send a non-empty string to the url parameter. In fact all other methods calls the AppendFormatted method, with ignored parameters set to "", so, they are just shortcuts to make your code shorter.

Note that appending text and changing font size can make the label width and height smaller than showing all the text, so, you may need to use the Label.Width and Label.Height to adjust the label size afterwards. You can also make one or both of them aut-size by setting it to -1. If you set the width to a fixed length (not -1), then the longer text will be wrapped to next lines, so you need to enlarge the Height or make it auto-size (= -1).
For more info, see the Label Formats app in the samples folder.

  1. More enhancements to the intellisense. For example, the auto completion list will offer the color names when you are in a pos of a color argument of a method. This will happen just you write the , in the argument list. If you hide the list and want to show it again, just press Ctrl+Space to show the color names again.
    Also, you can commit the suggested name from the completion list to a new line, just press Ctrl+Enter. This is helpful if you are splitting the arguments over multi-lines, so, when you write one argument then , and the auto completion appears to offer color, font or key names, just choose the name and press Ctrl+Enter to add it to the next line.

Don't miss a new sVB-Small-Visual-Basic release

NewReleases is sending notifications on new releases.