Results 1 to 4 of 4

Thread: Text Editor

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Post

    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?
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Calgary Alberta
    Posts
    359

    Post

    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.

  3. #3
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    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
    Micah Carrick
    Visual Basic 6 SP5
    Visual Basic.NET
    Quixotix Software
    [email protected]
    Download QCM 1.0 - Intelligent ActiveX Control Management

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Post 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
  •  



Click Here to Expand Forum to Full Width