-
[RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
:wave:
Hi, Do anyone know how to insert:
1) symbol :Eg: α, β (alpha and beta) and more...:bigyello:
2) Subscript and superscript? :cool:
3) last but not least a professional mathematics equation? ;)
into the interface (with label or anything) of the VB program :check:
-
Re: How to insert symbol, subscript, superscripts and mathematics equation in VB form
you can use equation editor in an ole object
check out http://www.dessci.com/en/products/ee...htm#other_apps
-
Re: How to insert symbol, subscript, superscripts and mathematics equation in VB form
Removed due to double post.
-
Re: How to insert symbol, subscript, superscripts and mathematics equation in VB form
I like what Westconn1 suggested as it seems quite powerful. If you decide to build from scratch then the Chr(n) function returns the ASCII chr. The Symbol font has many of the fonts you need and it's what I used in this example.
Code:
Option Explicit
' Set Text1.Multiline = True in the Properties window
Private Sub Form_Load()
Dim i As Integer
Form1.WindowState = vbMaximized
Form1.Show
With Text1
.Font = "Symbol"
.FontSize = 14
.FontBold = True
.Text = ""
.Height = Form1.Height
.Width = Form1.Width
.Left = Form1.Left
.Top = Form1.Top
End With
For i = 1 To 255
Text1.Text = Text1.Text & Chr(i)
Next i
End Sub
-
Re: How to insert symbol, subscript, superscripts and mathematics equation in VB form
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
CDRIVE
Love your loop idea :thumb:
I use CharacterMap alot (the program that comes with Windows),
but it is kind of a pain to mentally translate the Hex designation
to a numeric (1-255) designation. I could see one creating a companion
app using your loop idea to enable a mouseover to return a numeric
value for use with the Chr function.
Spoo
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
Quote:
I could see one creating a companion
app using your loop idea to enable a mouseover to return a numeric
value for use with the Chr function.
i have been using a small app like that (not mouseover, but cursor position) to find any non printing characters in any string, displays the ascii value in separate textbox
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
Spoo, you might like this. I wrote it some time ago when all my variables used type symbol designators. Set the TextBox to Multiline. The program uses 1 TextBox, 3 ListBoxes and 1 CheckBox. List1 holds all the Fonts Collection, List2 holds Font size and List3 holds the range of Chr(n) to loop through. Check3 selects whether or not the Chr Code is displayed next to the ASCII char. Too lazy to zip this!;)
Edit: Just realized that there's only one named variable!:rolleyes:
Code:
Option Explicit
Dim i%
Private Sub Check3_Click()
DisplayChrCodeYesNo
End Sub
Private Sub Form_Load()
Show
Check3.Caption = "Show Char Code"
List1.Height = Me.Height - 3000
Text1.Width = 12400
For i = 8 To 20
List2.AddItem i
Next
List2.ListIndex = 0
For i = 0 To Screen.FontCount - 1
List1.AddItem Screen.Fonts(i)
Next
List1.ListIndex = 0
List3.AddItem "ChrCodes 1 To 128"
List3.AddItem "ChrCodes 128 To 255"
List3.AddItem "ChrCodes 1 To 255"
List3.ListIndex = 0
End Sub
Private Sub List1_Click()
DisplayChrCodeYesNo
End Sub
Private Sub List2_Click()
Text1.FontSize = List2.List(List2.ListIndex)
End Sub
Private Sub DisplayChrCodeYesNo()
Text1.Text = ""
Text1.FontName = List1.List(List1.ListIndex)
If List3.ListIndex = 0 Then
For i% = 1 To 128
If Check3.Value = vbChecked Then
Text1.Text = Text1.Text & "Chr" & i% & "= " & Chr(i%) & " "
Else
Text1.Text = Text1.Text & Chr(i%) & " "
End If
Next
End If
If List3.ListIndex = 1 Then
For i% = 128 To 255
If Check3.Value = vbChecked Then
Text1.Text = Text1.Text & "Chr" & i% & "= " & Chr(i%) & " "
Else
Text1.Text = Text1.Text & Chr(i%) & " "
End If
Next
End If
If List3.ListIndex = 2 Then
For i% = 1 To 255
If Check3.Value = vbChecked Then
Text1.Text = Text1.Text & "Chr" & i% & "= " & Chr(i%) & " "
Else
Text1.Text = Text1.Text & Chr(i%) & " "
End If
Next
End If
End Sub
Private Sub List3_Click()
DisplayChrCodeYesNo
End Sub
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
Quote:
Originally Posted by westconn1
i have been using a small app like that (not mouseover, but cursor position) to find any non printing characters in any string, displays the ascii value in separate textbox
West, are you going to post it?
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
will do later, from my computer, but it is a pretty simple thing i did some time ago
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
CDRIVE
Nice. Thanks... will check out later (kinda in the middle of something right now).
Spoo
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
Hi i had tried the using equation editor in an ole object
but the symbol is too big in size and the subscript and superscript is too far from the letter.
Is there any method of control the font size?
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
Quote:
Originally Posted by greatgerd
Hi i had tried the using equation editor in an ole object
but the symbol is too big in size and the subscript and superscript is too far from the letter.
Is there any method of control the font size?
Are you referring to the editor that Westconn1 supplied a link to?
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
Quote:
Hi i had tried the using equation editor in an ole object
but the symbol is too big in size and the subscript and superscript is too far from the letter.
Is there any method of control the font size?
i would suggest using equation editor in word, to start, till you find out what some of the options are, you can change sizes for super and subscripts, also change kerning to move things closer together also define new sizes
if you are using similar equations regularly you can save in a word document or similar then just copy to your app
you can also change spacing by rescaling the object, by width or height
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
Yep I am reffering to WestConn pete reply.
I don't know much about VB6, So I choose the easy method hehe..
I am using Microsoft Office 2007. so Mic. Words is different.I can't edit anyting.
but I still can use Mic.Publisher to do the editting and kerning.
Thanks a lot
-
Re: [RESOLVED] How to insert symbol, subscript, superscripts and mathematics equation in VB form
@ cdrive
Quote:
West, are you going to post it?
decided to post to codebank, rather than in this thread http://www.vbforums.com/showthread.p...50#post3431550