Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Strange Font Problem(Resolved)


I'm trying to use the First Quarter Moon and Last Quarter Moon symbols from the Wingdings 2 font.
They look like crescent moons.

I need a way to acquire them for pasting into an MS Word file.
But I can't seem to get them.

If you copy them from the Windows Character Map and paste them into a RichTextBox, they show up properly.
But if you do an ASC() on the pasted Chars you get an ASCII of 63 for both of them.

If you try to add Chr$(63) to the RichTextBox you get some other char altogether.

How the heck do you get them?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Strange Problem With Font Scripts
I have a problem which I find a bit mysterious....

We have an MDI Form in which the same Child Form can be opened many times. This Child Form contains a RichText Box. The problem is that whenever we lauch a new Child Form, the Font's script changes. I have two languages installed. These are English (Default) and Greek. When I lauch the first Child Form Greek Characters are selected. If I launch a new Child Form, then English is selected... When I launch a third Child Form then the selected language is Greek and so on. I can't understand what's happening. The preselected Font of the RichText Box is Tahoma, Greek Script.

There is no event in the app which sends any keystrokes or changes the script....


Where I want to conclude is:

Is there a command to define the script during runtime (I will put it in the Child Form Form_Load Event) so I can tell the program what Script to choose?
Or even better, is there a way to determine which Language - Script is selected at the time being and set it as the RichText boxe's script?

Thanks....

I Have A Strange Problem **Resolved**
I make a simple chat program and ran into a little problem I didn't have before I included EventVB.dll to manage my min/max form size.

I had it searching a string to find things like "" and it was working just fine until I added eventvb into the mixture...

I have included my project files. for you to look at.

Please look at the line:

VB Code:
lFoundPos = RTB_Listen.Find(sFindString, lFoundPos + 2, , rtfNoHighlight)


it's telling that "sFindString" isn't defined but it worked until I added eventvb

http://www.rcw-online.com/download/VB_Problem.zip

Strange DB Behaviour [Resolved I Think]
This is really strange. I have an 'update' button on form, which updates a DB with new entries. The function GetLastUpdated is in a module.


VB Code:
Private Sub cmdUpdate_Click()           Set UpdateBrowser = New InternetExplorer    'Get last message number to update.    LowNum = GetLastUpdated    CurNum = LowNum    GettingLast = True    cmdUpdate.Enabled = False    cmdStopUpdate.Enabled = True    'Update DB from last update    UpdateMessageEnd Sub Public Function GetLastUpdated()    On Error Resume Next        'Find the last message we have stored.    Set rs = New ADODB.Recordset    rs.Open "Table1", cn, adOpenStatic, adLockPessimistic, adCmdTable    rs.MoveLast        'This is last message.    GetLastUpdated = rs("Number")    rs.CloseEnd Function


So it should retrieve the number of the last record in the DB, so it can update from there onwards.

Its funny though, because I can update from say number 40005 to 40010 which will work fine. Close the program and look in the DB and the entries are there. However next time i run the program it only finds as far as 40005 even though the records are there.

Any idea why? Im scratching my head over this one.

Strange Problem *Resolved*
I have the following code


VB Code:
Private Sub Command1_Click()On Error GoTo error com.Filter = "databases(*.mdb)"com.ShowOpen'com.FilterIndex = 2FileName = com.FileNameOpen FileName For Input As #1dbtext.Text = FileNameClose #1 Exit Sub error: End Sub Private Sub Command2_Click()On Error GoTo error com.Filter = "Acrobat Reader(*.exe)"com.ShowOpen'com.FilterIndex = 2FileName = com.FileNameOpen FileName For Input As #1artext.Text = FileNameClose #1 Exit Sub error:End Sub Private Sub Command3_Click()Unload MeEnd Sub Private Sub Form_Load() Open App.Path & "dbloc.cfg" For Input As #1        dbtext.Text = Input(LOF(1), 1)Close #1 Open App.Path & "arloc.cfg" For Input As #1        artext.Text = Input(LOF(1), 1)Close #1 End Sub Private Sub Form_Unload(Cancel As Integer)    Open App.Path & "dbloc.cfg" For Output As #1    Print #1, CStr(dbtext.Text)    Close #1    Open App.Path & "arloc.cfg" For Output As #1    Print #1, CStr(artext.Text)    Close #1End Sub


Every time i close this form it add's II to the textfile, (See the attach file for a picture, if you don't understand). Every time i close the form, it add's an II, i you do this a couple of time you'll get IIIIIIIIIIIIIIIIIIIIIIIIIII.

Does anyone know how to fix this?

Many thanx,

Broes Willems

***RESOLVED***Very Strange Problem
I have a 2 text boxes in my form, a couple of labels & a couple combos....when I load the form, I cant type in any or select anything...as if its not the active form...the form that loads before that is all good but the second form...does not respond to anything...ANY IDEA WHY, it was all working and I havent added or removed anything...really!!!

Strange Occurance!!!!RESOLVED
hi can anybody solve my mystery, if i place a common dialog box on my form, it changes to a picture box when i next open my project.

Strange Formatting Problem (Resolved)
Greetings,

I need to display the hex values of the characters in a string.
So I am using Format(Hex(Asc(MyStringCharacter)),"00") to work through the string and display the values.

All seems well apart from when the character is a colon.
Format(Hex(Asc(":")),"00") returns "00" when it should be "3A".

The only thing I can think of is that is in some way related to the fact that this is the time delimiter.
The only way I can think of to solve this would be to test for the character being ":" and taking appropriate action.
This is not a very elegant solution and what if there are other characters that do not convert correctly?

Any ideas?

Strange Scroll Pic Problem ( Resolved )
Hi there...

So far i can scroll my picture just fine, untill I attempt to resize things. Then i get a strange effect. Here is my code.

' Picture 1, containing picture 2 ~ with a image 5587 x 2880
' 1 horizontal scroll, 1 vertical scroll bar
' form, picture1 & 2 scalemode is set to pixel.
'''''''''''''''''''''''''
Private Sub Form_Load()
Picture2.Top = 0
Picture2.Left = 0
HScroll1.Max = Picture2.Width - Picture1.Width
HScroll1.Min = 0
VScroll1.Max = Picture2.Height - Picture1.Height
VScroll1.Min = 0
End Sub

Private Sub Form_Resize()
' Picture1.Width = Me.Width - 225
Picture2.Top = 0
Picture2.Left = 0
HScroll1.Max = Picture2.Width - Picture1.Width
HScroll1.Min = 0
VScroll1.Max = Picture2.Height - Picture1.Height
VScroll1.Min = 0
End Sub


Private Sub HScroll1_Scroll()
Picture2.Left = 0 - HScroll1.Value
End Sub
Private Sub VScroll1_Scroll()
Picture2.Top = 0 - VScroll1.Value
End Sub
'''''''''''''''''''''''''''''''''''''
Everything works fine if the first line under Resize is commented out. But as soon as i attempt to make the picture holder fit the new size, the defication hits the turbines.

Any help appreciated.

**RESOLVED **Strange Results From A Recordset???
In the following code I am simply filling a combo box with data from a table:

VB Code:
Const rsERROR As Long = 3021On Error GoTo EH1     sSql = "SELECT * FROM tblLogin ORDER BY [ID]"    Set rs = New ADODB.Recordset    rs.Open sSql, CN, adOpenDynamic, adLockOptimistic txtDateTime.Text = Now Do Until rs.EOF = True    With cmbRepName        .AddItem rs.Fields("Sales Rep")        rs.MoveNext    End With        If Not IsNull(rs.Fields("ID").Value) Then        With cmbLoginID            .AddItem rs.Fields("ID")            rs.MoveNext        End With    Else        rs.MoveNext    End If     LoopCloseRS rs  sSql = "SELECT * FROM KeyedBy"    Set rs = New ADODB.Recordset    rs.Open sSql, CN, adOpenDynamic, adLockOptimistic Do Until rs.EOF = True    With cmbKeyedby        .AddItem rs.Fields("KeyedBy")        rs.MoveNext    End With LoopCloseRS rs  sSql = "SELECT * FROM Products"    Set rs = New ADODB.Recordset    rs.Open sSql, CN, adOpenDynamic, adLockOptimistic Do Until rs.EOF = True    With cmbProducts        .AddItem rs.Fields("Products")        rs.MoveNext    End With LoopCloseRS rs sSql = "SELECT * FROM Sales ORDER BY DateTime"    Set rst = New ADODB.Recordset    rst.CursorLocation = adUseClient    rst.Open sSql, CN, adOpenDynamic, adLockOptimistic        rst.MoveLast    FillData 'fills comboxes & labels with appropriate data from the Access table    EH1:    If Err = rsERROR Then        If rs.BOF = True Then            rs.MoveFirst        End If    End If
The result is for the field ID it is pulling every other ID from the table...so it skips record 2, 4, 6.....

This was working fine as far as I know...then I was told by users that they were getting an error...which turned out to be Run-time error 3021 Either BOF or EOF is true...

I then placed the Error Trap for the BOF, because I all ready had the EOF within the loop...

Has anyone ever seen this??? And if so, does anyone know what I can do to resolve it?

Thank you.

Strange VB 6.0 Systray Occurances... - Resolved
Well, I did a lot of searching on the forum, and I couldnt find anything similar to my experience so here goes....



I do much of my coding in VB 6.0 on a system running windows 2000 Professional, however sometimes I work on my projects on an XP machine... once i do that, the systray menu almost NEVER works again, which means I have to copy and paste the code and controls into a new project on a win2k machine to fix it, after doing that, everything works fine again.... this makes no sense to me as to why I would need to do this.. an explination, or maybe a better way to do this would be much appreciated

THANX!

Code I use:

This goes in a module

VB Code:
'user defined type required by Shell_NotifyIcon API call      Public Type NOTIFYICONDATA       cbSize As Long       hwnd As Long       uId As Long       uFlags As Long       uCallBackMessage As Long       hIcon As Long       szTip As String * 64     End Type        'constants required by Shell_NotifyIcon API call:      Public Const NIM_ADD = &H0      Public Const NIM_MODIFY = &H1      Public Const NIM_DELETE = &H2      Public Const NIF_MESSAGE = &H1      Public Const NIF_ICON = &H2      Public Const NIF_TIP = &H4      Public Const WM_MOUSEMOVE = &H200      Public Const WM_LBUTTONDOWN = &H201     'Button down      Public Const WM_LBUTTONUP = &H202       'Button up      Public Const WM_LBUTTONDBLCLK = &H203   'Double-click      Public Const WM_RBUTTONDOWN = &H204     'Button down      Public Const WM_RBUTTONUP = &H205       'Button up      Public Const WM_RBUTTONDBLCLK = &H206   'Double-click       Public Declare Function SetForegroundWindow Lib "user32.dll" (ByVal hwnd As Long) As Long      Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" _      (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean       Public nid As NOTIFYICONDATA

This is on Form_Load()

VB Code:
Me.Show       Me.Refresh       With nid        .cbSize = Len(nid)        .hwnd = Me.hwnd        .uId = vbNull        .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE        .uCallBackMessage = WM_MOUSEMOVE        .hIcon = Me.Icon        .szTip = Form1.ProgVer & vbNullChar       End With       Shell_NotifyIcon NIM_ADD, nid

This is on Form_MouseMove

VB Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'Minimize to tray script Dim Result As LongDim Msg As LongIf Me.ScaleMode = vbPixels Then    Msg = XElse    Msg = X / Screen.TwipsPerPixelXEnd IfSelect Case Msg    Case WM_LBUTTONUP        Me.Show        Me.WindowState = vbNormal        Result = SetForegroundWindow(Me.hwnd)    Case WM_LBUTTONDBLCLK        Me.WindowState = vbNormal        Result = SetForegroundWindow(Me.hwnd)    Case WM_RBUTTONUP        Result = SetForegroundWindow(Me.hwnd)        Me.PopupMenu Me.mPopupsysEnd SelectEnd Sub


I'm pretty sure I grabbed everything, if I missed anything let me know

Strange Behavior Of A SSTab: [PROBABLY Resolved]
I'm using a TabStrip with 4 tabs. When I run the app and load a large data file in memory, a 200 x 200 matrix of single precision values, there seems to be a memory problem for when I click on tab #0 (tab #2 is currently being displayed) it is not refreshed or, rather, the contents is the same as that from tab #2.

Do you folks think this looks definitely like a memory problem? I'm using fixed size arrays. Do you think the problem could be solved by using dynamic arrays & redim & all that stuff? It'll mean going through much trouble and I wouldn't like to spend time on it if it's not worth the effort.

Strange Label2 Action (RESOLVED)
hy I'm doing a Slot Machine but...
try to bet 21 points or more and see on "Your Bet"

the problem is in here:

VB Code:
Private Sub Label1_Change()If Label1.Caption < 0 ThenLabel2.Caption = Label2.Caption + Label1.CaptionLabel1.Caption = 0End IfEnd Sub


thanks

Strange Problem With SQL Statement-Need Help!!&lt;Resolved&gt;
I have a very strange problem with a SQL statement. I am trying to add a field to my Access Database in an Memo field.
The data is from the clipboard.GetText() statement. this data sometimes includes the apostrophe character. when the SQL statement finds this it gives me an error in the line and halts.

Problem is I need the apostrophe character to be part of the data in the memo field. I can cut/paste this data directly into my Database with no problem.

Can someone tell me how to work around this problem?

Code: strSQL = "INSERT INTO [" & cboTableNames.Text & "]" & _
      " ( [Snippet], [Description], [Code], [Notes] ) " & _
      "VALUES " & _
      " ('" & txtSnippetName.Text & "' ," & _
      " '" & txtSnippetDescription.Text & "' ," & _
      " '" & txtSnippetCode.Text & "' ," & _
      " '" & txtSnippetNotes.Text & "' )"

Thanks in advance
Charles



Edited by - kf4iis on 7/17/2003 4:47:08 PM

&lt;RESOLVED&gt; Get A Strange Error With ShellExecute
I declared the function for Shell Execute and the following code works, however, I do get an error.

Code:
       ReturnVal = ShellExecute(Me.hwnd, "open", myURL, vbNullString, myURLPath, 1)


The Error I get is a small message box that pops up with the title "copymov", a exclamation triangle, and the message "E_FAIL", and an "OK" button. The ReturnVal is 42, which I have no idea where to look that up.

When I press the "OK" button (or alternatively press the 'X') on the message box my application goes ahead and opens just fine with the file I am pointing to.

Does anyone have any ideas what is causing this eye sore? I reall don't want to distribute code that gives erroneous errors.



Edited by - Patrick Gorman on 12/26/2003 2:37:33 PM

Strange Usercontrol Sizing Issue (Resolved)
I'm making a user control that has an ImageBox with a preset image that's 20 pixels tall.

The programmer using the control has the option to change the image, for now we'll stick with 20 for the height.

The Usercontrol scalemode is set to vbPixels

If I read the height of the image box, as it starts loading, it reads 20 as it should.
But when the Usercontrol gets resized, the height of the image box changes to say it's 23.47059 pixels tall.
But it isn't, it's still 20.

What the heck is going on and how do I get the true height after the control has been resized?

*RESOLVED* - Recordset Issue - Very Strange - Update
Experiencing very strange error:

Run-time error '-2147217900 (80040e14)':
Syntax error in FROM clause.

------------

Very basic from clause:

SELECT * FROM references

That's it.

I have my db opened and already two recordsets using different tables opened. This third recordset doesn't seem to want to do anything.

Here's the snipet:

cmpsql2 = "SELECT * FROM References"
MsgBox (cmpsql2)


Set cmprec2 = New ADODB.Recordset
cmprec2.Open cmpsql2, cmpdb, adOpenStatic



Is there a limit on recordsets that you can have open at one time? I didn't think there was?


thx as always


UPDATE:

I just blew the table away and recreated. I also changed the code in my program for this table to be the very first one used. Same error message popping up. I don't get it.

Strange Date/Access Problem ***Resolved***
Hi All,

I have the following SQL statement to a Access Database

==============
SELECT * FROM odb WHERE rDate > 01/01/2002
==============

Now in my mind this simple statement will select all records where rDate is greater than "01/01/2002".

But it is not working and is selecting all records in the database all the time.

Where is the really obvious problem that I am missing

Font Possible?*Resolved-thanks :)*
I don't think this is possible but can you change the color or font of the title of your program at the top where the icon goes (I think it's called a menu?) and also can you locate your program in a certain place on the users screen? I want it in the top left corner of the users computer? Well all help and ideas are very much appreciated

UserControl Font (Resolved)
When you add a normal control to a form, say a TextBox, its properties window only shows 'Font' but you still have access to FontSize, FontName, etc.

But when making a user control you don't get direct access to the properties of the font unless you add them one at a time.

If you add all the properties it makes a very long Properties window.

Is there anyway around this?

Rtf Font Change (RESOLVED)
Hello,

How can I change the fontsize of an entire RichText Box through code? I want to click a button and the whole rtf box changes font size.

RESOLVED Signature Font...how To Print?
I have a font which contains a signature I need for
printing checks. I can open the font file and see
the signature. It has lots of boxes around the picture
of the signature, not sure what they are, maybe
spaces. Can anyone help me with how to make the
signature print out? Gosh I feel dumb today.

MessageBox Font Color (RESOLVED)
Hello everybody

How can I set the foreground color of the text displayed on a MessageBox?

thx, in advance

George Papadopoulos

Loading New Font At Startup *RESOLVED*
I want to include small fonts in the resource file for my application. This is to overcome a problem when users have 'large fonts' selected, if this setting is OEM then small fonts are not installed until the user has changed from 'large fonts'

I have written some code that extracts the font from the resource file, and adds it to the system table. This code gets run from my splash screen, however when the main form loads it does not use small fonts but has decided to use Aerial instead.

If I run my code for a second time, but without running RemoveFontResource on exit from the first run, then my app uses small fonts ok.

Can I add anything to my code to ensure that my main form uses small fonts as designed:

Heres the code I am using


VB Code:
Option Explicit Private Const HWND_BROADCAST = &HFFFF&Private Const WM_FONTCHANGE = &H1D Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As LongPrivate Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long Private added_small_fonts As Boolean Public Sub Check_for_Small_Fonts() Dim a As LongDim byte_array() As ByteDim file_no As IntegerDim found_font As Boolean For a = 0 To Screen.FontCount - 1   If Screen.Fonts(a) = "Small Fonts" Then found_font = TrueNext added_small_fonts = False If found_font = False Then    byte_array = LoadResData(101, "CUSTOM") ' get font out of res file      'Create temp file      file_no = FreeFile   Open App.Path & "/smalle.fon" For Binary Access Write As #file_no      Put #file_no, 1, byte_array   Close #file_no        ' Add font to system table   If AddFontResource(App.Path & "/smalle.fon") > 0 Then      added_small_fonts = True      SendMessage HWND_BROADCAST, WM_FONTCHANGE, 0, 0   End If   End If End Sub Public Sub Remove_Small_Fonts() If added_small_fonts = True Then ' only remove if added by Check_for_Small_Fonts function   If RemoveFontResource(App.Path & "/smalle.fon") > 0 Then      SendMessage HWND_BROADCAST, WM_FONTCHANGE, 0, 0   End IfEnd If End Sub


Thanks for any help

Combo Box && RTF Font Color [RESOLVED!]
I have set up a combo box, when the user selects a font color from the list it first colors the font color of the combo, then the font color for the RTF. I have this code:


VB Code:
Private Sub cboFontColor_Click()'Change font colorOn Error Resume NexttxtMain.SetFocus    Select Case cboFontColor.Text        Case "Black"        cboFontColor.ForeColor = vbBlack        txtMain.SelColor = vbBlack        Case "Blue"        cboFontColor.ForeColor = vbBlue        txtMain.SelColor = vbBlue        Case "Green"        cboFontColor.ForeColor = vbGreen        txtMain.SelColor = vbGreen        Case "Magenta"        cboFontColor.ForeColor = &HFF00FF        txtMain.SelColor = &HFF00FF        Case "Maroon"        cboFontColor.ForeColor = &H40&        txtMain.SelColor = &H40&        Case "Navy Blue"        cboFontColor.ForeColor = &H400000        txtMain.SelColor = &H400000        Case "Orange"        cboFontColor.ForeColor = &H80FF&        txtMain.SelColor = &H80FF&        Case "Purple"        cboFontColor.ForeColor = &H800080        txtMain.SelColor = &H800080        Case "Red"        cboFontColor.ForeColor = vbRed        txtMain.SelColor = vbRed        Case "Silver"        cboFontColor.ForeColor = &HC0C0C0        txtMain.SelColor = &HC0C0C0        Case "Teal"        cboFontColor.ForeColor = &H404000        txtMain.SelColor = &H404000        Case "White"        cboFontColor.ForeColor = vbWhite        txtMain.SelColor = vbWhite        Case "Yellow"        cboFontColor.ForeColor = vbYellow        txtMain.SelColor = vbYellow        Case "Default"        cboFontColor.ForeColor = &H606060        txtMain.SelColor = &H606060        Case "Custom"        dlgFontColor.ShowColor        cboFontColor.ForeColor = dlgFontColor.Color        txtMain.SelColor = dlgFontColor.Color    End SelectEnd Sub


The strange problem is, it doesnt error (even with out on error resume next. And it doesnt change the font color of the RTF. Why is this? I know i have my select case working right because the same code is used for changing the background color. (obviously though i used txtMain.BackColor and not txtMain.SelColor.) Anyway why does the color not change?

Font In Resource File - RESOLVED
being a web designer, i have paid good money for a bunch of fonts i have, and i want to use one of these fonts in my app.

however, since i paid for it, i just dont want to install the font onto the system, cause then it can be freely distributed.

now, when i goto add a font to the resource editor, it puts it under a custom user resource heading, and when i go to access it using LoadResData(101,8) i get a runtime error

on msdn it has that you can add it especially as a font resource, but in the editor there is no button to add it as a font resource.

Any ideas on how i can accomplish this?

How To Change Font Of A String At Run Time?***RESOLVED***
Hello out there

I would like to know, if it is possible to change the font(Bold, Italics, size etc) of a string at run time.

For example: I want to change a part of a string to be Bold in a Msgbox "prompt" string. So that when the message appears, another part of the message is Bold.

I know that in HMLT, you can code something like this e.g.
<B>[UserName]</B>, now, how do you do that in the following VB code:-


VB Code:
MsgBox "Good Morning Sir," _& vbnewline & "Your ID is: ID" & Code, "Code ID"


Now, I would like to have IDCode, or like ID14526, when the message box is shown. Ho do I make it bold??

Thanks in advance.

Wizard

Checking The System Font From My Control&lt;RESOLVED&gt;
I am guessing that containers like Outlook-style explorer controls must get the font settings from the system since they don't expose a font property. My control will have a titlebar with a caption, sort of like the one above the treeview in Explorer. I need to set the height of the titlebar by the height of the font, but I'm not sure how to check if the user has large font settings. Can somebody point me in the direction of whatever api I might need? thanks


God Bless America

Edited by - IDontKnow on 6/9/2004 1:28:38 PM

Font, IFont, StdFont, LogFont, Etc &lt;RESOLVED THANKS&gt;
I have been concentrating on graphics and usercontrols for a while now, but my education seems to be missing something basic here!

I made a control that has a caption property, so for the font I used the standard Font object. It works just fine. I honestly don't understand the purpose for all the different types of fonts. The LogFont I know is used for things like vertical fonts, so I can understand that one. What has me really confused is when I look at downloaded control examples. Almost nobody uses the simple Font object like I did. Why? Is there a problem or limitation with it that I haven't learned or is it just programmer-preference? I am inclined to believe there must be a limitation because the advanced controls at places like vbAccelerator, TheVBZone, and Karl Peterson's site never use the simple Font. How do I know when to use stdFont or IFont or any of the others?

Thanks to anybody that can shed some light on this!


God Bless America

Edited by - IDontKnow on 5/29/2004 12:10:15 PM

Change The Color Of Combo Item Font **RESOLVED**
Hello all
well, I have this in my prog:

VB Code:
Private Sub AddB_Click()On Error Resume NextIf iBandas.ListIndex = 0 ThenText1(0).Visible = TrueText1(0).Text = iBandas.TextElseLoad Text1(iBandas.ListIndex)Text1(iBandas.ListIndex).Text = iBandas.TextText1(iBandas.ListIndex).Visible = TrueText1(iBandas.ListIndex).Top = Text1(0).Top + iBandas.ListIndex * 375End IfEnd Sub Private Sub Form_Load()Dim MyFile As StringDim MyPath  As StringMyPath = "C:Bandas" MyFile = Dir(MyPath) Do While MyFile <> ""iBandas.AddItem MyFileMyFile = DirLoopEnd Sub Private Sub RemB_Click()On Error Resume NextIf iBandas.ListIndex = 0 ThenText1(0).Visible = FalseText1(0).Text = ""ElseText1(iBandas.ListIndex).Text = ""Unload Text1(iBandas.ListIndex)End IfEnd Sub

so, when i click in Button AddB it loads on text box and the text in combo1...
well.. i need that if an Item have already been loaded, its name in Combo1 changes the font color, or something to know that that item have already been loaded...
understand??

thanks in advance

Font Size In Relation To Number Of Pixels In Height???(*Resolved*)
Hi all

Does anyone here know exactly how many pixels on the x axis that say a 10pt font would use??

is 10pt 10 pixels??

Thanks in advance

Detecting The Current Font And Font Size On Various Lines In A Rich Text Box.
I have written an editor that uses a rich text box as the main text area.

The editor allows the user to select a font and font size on the toolbar.

My question is, how does one get the combo box text (for both the font and font size) to display the font or font size for the current line of the current character location?

Meaning, if I were to type in two lines, the first line being Arial 12pt, and the second line being Tahoma 14pt, how would I get the program to display the font and font size in the combo boxes?

I know about SelFont, SelStart and such, but I am not selecting any text. I am merely moving the cursor up or down and need to be able to display the font and font size for where the cursor currently is.

Anyone have any ideas?

I thank you in advance.

Parse &lt;font .... &lt;/font&gt; Tag And View The Progress Into A Rich Text Box (Solved)
Hello, does anyone know how to parse the <font ... > </font> tag from an html file and view the output into a Rich Text Box? Using VB Code and even RTF code if you want.

For example: i have this tag

<font name="Arial" size="3" color="#FF0000>Hello</font>

Hello

Detecting Font And Font Size On Various Lines In A Rich Text Box.
I have written a basic editor that uses fonts and such, however when I select a different line (while entering text into the text area of the rich text box), it doesn't display the font or font size for that particular location.

Does anyone have any ideas where I can look to solve this problem?


I thank you in advance for any information you may be able to share with me.

How To Save Text Fontsize, Font Style And Font Color
When I save the text in a Richtextbox to a Access Database, How to save the font style and Font color with the text (Assume that user can change font style and color when they typing text into the richtextbox).

Then when I load the text from Access Database back to the Richtextbox, it should associate with it's font style and color when I was saved.

How to realize these functions???

Thanks in advance

How To Get The Font Name And Font Size Of Header/footer Text?
Hi Everybody

Simple question.

In one of my procedures, I write the VBA Excel code set the text for headers and footer specifying the font name and font size (code line shown below in part).


Code:
'...
'...
'worksheetName has been previously defined to contain the
'name of the worksheet being handled
fullFilename = ActiveWorkbook.FullName
footerText = fullFilename & "[" & worksheetName & "]"
With ActiveSheet.PageSetup
.LeftFooter = "&""Times New Roman,Regular""&06" & footerText
End With
'...
'...


However, when I try to read the same (header/footer text) using code and assign it to a string variable, it actually includes the VBA code referring to the font name and font size as well. This is what I get (the contents of the string variable is shown below).

&"Times New Roman,Regular"&06H:MSOFFICEMY DOCUMENTSCombined National Monthly ReportTest11.xls[SBU - East]

Have a look at all the text prior to "H:..."

But when you see the header/footer content in pagesetup -> headers/footers, you only see the actual text viz :-

"H:MSOFFICEMY DOCUMENTSCombined National Monthly ReportTest11.xls[SBU - East]"


Is there a way to read this actual text only in to a string variable?


Best regards


Deepak Agarwal

Retain Font Styles When Changing Font Size
March 25, 2008

Re: VB6

Hello, everyone. I searched for over two hours for an answer but didn't find a relevant forum example. I am using a richtextbox for my documentation. I made several simple font features such as font sizes and font styles (bold and underline) to the richtextbox. The problem I have is that after I bolded and underlined some of my document text, if I change my document to a different font size, any text that have been bolded or underlined will be undone, so I have to highlight them and bold or underline them again. Does anyone have any advice or any example code to correct it?

The following is a fragment of code in selecting for fontbold and for changing font size:

If Len(Trim(RichTextBox1.SelText)) > 0 Then' For selecting text
RichTextBox1.SelFontSize = 14
End If
RichTextBox1.SelBold = Not (RichTextBox1.SelBold)' For selecting text for bold
RichTextBox1.Font.Size = 14 ' Font size to the whole document or richtextbox

Any advice or help will be greatly appreciated.

Mydanvue

Load Font Sizes Depending On Selected Font
I have lokked and looked for thi sbut cant find anything about it. I want to be able to select a font from a combo box and have the correct font size apper within another combo box to choose from. How do I go about loading the proper font sizes for the fonts.

How To Use The Dos Font And Avoid Windows Font While Printing Reports
how to use the dos font and avoid windows font while printing reports in textmode from vb

How Do I Display Font Combo, With Each Name Written In It's Font Style?
Hi, I'm trying to create a mini word processor in my VB6 app.
I'd like to have a font combo that displays each font's name in it's
own font style. (Like MS Word has.) Can anyone suggest a control to
use for this?

TIA,
simondeutsch

Vb6 - How To Change MDI Form Caption Font I.e. Titlebar Font
How can i change MDI form titlebar text font? i want to use different font than system font, i tried SystemParametersInfo() API function but failed. remember i am a beginner

How To Change The Font Type And Font Size For A Menu Bar?
Dear all,
I meet a problem in my application. How can i change the font type and font size for the menu used in th form? Since my application is run on 1280x1024, it is too small to see the type on the menu bar. Could anyone help me? Very urgent!!! Thanks.

Paul

Changing Default DC Font To MsFlexGrid.Font.Name
When I need to obtain a font LONG value for a command button, I make the following:


ButtonFont = SendMessage(Command1.hWnd, WM_GETFONT, 0&, 0&)


I need to do the same for a MsFlexGrid and the function returns 0.
In this case, and because I need to change de default Device Context font (SYSTEM) to the MsFlexGrid.Font.Name, I'm unable to change it.

How can this question be solved ?

Thanks in advance

CommonDialog Box Font Box - Font Doesn't Change
Hi,
I'm using the ShowFont feature of CommonDialog in VB 6.

I have a Rich text box called RTB1


With comDlg1
.DialogTitle = "Font" 'set the dialog title
.Flags = cdlCFBoth
.ShowFont
End With

RTB1.SelFontName = comDlg1.FontName
RTB1.SelFontSize = comDlg1.FontSize
RTB1.SelBold = comDlg1.FontBold
RTB1.SelItalic = comDlg1.FontItalic
RTB1.SelStrikeThru = comDlg1.FontStrikethru
RTB1.SelUnderline = comDlg1.FontUnderline


When I select a font from the box and hit ok - I don't see the font change in the Rich Text Box (for e.g, the font size) .. I step through the code and the .SetFontName , .SelFontSize etc properties of the Rich Text box are getting set from comDlg1 ... but there're no visible changes to the font..


Appreciate any help - thanks.
Saad

FrmMain.Font = (How I Can Load A Font From Resource) ?
Is it possible to load a font in my form from a resource file...?
I made a search in the vb-forums but i only found that you can load a font from a file...
Can anybody help me out...?

This is the link to load a font from file:
http://www.vb-forums.com/showthread....=font+resource

Font Icons (like In The Change Font Dialog)
Ok, im loading fonts into a combobox (ComboBoxEx) - And I want to add the proper icon next to each font if they have one, like it is in the Change Font system dialog.

Im using the character set value right now but by comparing my results to the change font dialog, I dont think thats close to right, or im just not doing it right.

Can someone show me how to determine what icon (if any) goes to a particular font?

Changing Font Size And Bold And Font ???
dim Heading as string
Heading = "I want to Make this sentance Bold and bigger"

how would i go about making this variable bold and changing the font and font size.
thankyou

Checking Available Font Sizes For A Given Font
In my program I want to change the Font often on different controls so I have opted for the word-processor approach rather than popping up the dialogFont each time.

I have the Buttons for Bold, Italic, Alignment and a Font Name picker. This all works fine.

Is there a way for me to find out what point sizes are available for a selected Font so that I can place these in a dropdown list as well ?

I can work around this by starting the fontsize at 6 and adding .5 continually upto 40 and checking which unique values are returned but It would be nice to do it with a cleaner method.


Code:
Dim wFontSizes(200) As String
'txtFontTest is an invisible Text Box

For i = 0 To Screen.FontCount - 1
a = ""
cbFont.AddItem Screen.Fonts(i)

For j = 6 To 40 Step 0.5
txtFontTest.FontSize = j
If txtFontTest.FontSize <> b Then a = a & " " & Str(j)
b = txtFontTest.FontSize
Next j

wFontSizes(cbFont.ListCount - 1) = a
Next i
Many thanks

I'm just going to populate my list with these sizes for each font - as per VB and MS Word - gives me a decent selection.

8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 40, 48, 72

Thanks for the replies.

Font Type && Font Size
Hi,

I was wondering what font type and font size you usually use in your vb projects.
What font size is too small, and what size is too big?
Do you use different fonts in your project? or maybe different font sizes?

As you noticed my question is some kind of a poll, I hope there will be much replies.

Thank you for your time!

OsMo

How Do You Get The Actual Font Name From The Font File
I need to get the font name that corresponds to the font file name.

Ex:

The font file name ADOLESCE.TTF corresponds to the name Adolescent (True type). How do I get that name from the file?

Copyright © 2005-08 www.BigResource.com, All rights reserved