|
-
Mar 7th, 2000, 08:56 PM
#1
Thread Starter
Frenzied Member
Hi all!
I'm programming a text editor, but when i'm trying to change the font, I get the
following error:
'No Font Exists'
I use the following code:
Cmd.ShowFont ' Commondialog
Font.Text.SelText = Cmd.FontName
What is wrong???
PS: How can I detect if a document has been changed and ask the user to save the I
changes.
PPS: How can I detect if the document already have been saved?
-
Mar 7th, 2000, 09:01 PM
#2
Hyperactive Member
I'm not sure about the font but for hte other, why don't you use a variable booSaved that is set to true until they change something. IF they click into the text area, don't set it but if they do any KeyPress etc, or change the font or anything like that set it to false. Then when they exit, check that variable, if it's true, don't do anything, if it's false, ask them if they want to save.
-
Mar 8th, 2000, 12:55 AM
#3
Addicted Member
You need to tell common dialog which fonts to show, screen fonts, printer fonts, or both; and whether to show the effects frame (underline strikethrough etc). This example shows all fonts and the effects frame...
CommonDialog.Flags = cdlCFScreenFonts Or cdlCFPrinterFonts Or cdlCFEffects
CommonDialog.ShowFont
Good Luck
-
Mar 8th, 2000, 04:07 PM
#4
Conquistador
Save Changes
or do this
Code:
Option Explicit
Dim textChanged As Boolean
Private Sub Text1_Change()
textChanged = True
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim Response As Integer
If textChanged = True Then
Response = MsgBox("Do you want to save changes?", vbYesNo + vbQuestion, "Save?")
If Response = vbYes Then
End
End If
End If
End Sub
that should work
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|