?
Solved

MDI NotePad Program

Posted on 1998-04-28
4
Medium Priority
?
368 Views
Last Modified: 2011-10-03
I am creating an MDI notepad program with a difference:  Each new notepad that is started is in a different font.  The name of the font is also given as the caption of that child form. 

The only items on the "File" menu are "New" (Which created a new child window) and "Exit". 

I am trying to figure out how to code a different font when a new notepad is created and giving the font name as the caption of that child form

TIA
Alexander
0
Comment
Question by:Millos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
chualk earned 20 total points
ID: 1433376
Try this :

Create an mdi form with menuname MDI_MNUFILE.
Create a form name frmNEWNOTEPAD

Declare in Module:
Public Index as integer

Private Sub MDI_MNUFILE_Click()
   
       Dim count As Integer

       count = Printer.FontCount
       index = (index + 1) Mod count

      Load frmNewNotePad
      frmNewNotePad.Show
      frmNewNotePad.Caption = Printer.Fonts(index)
      frmNewNotePad.RichTextBox1.Font = Printer.Fonts(index)


End Sub
0
 
LVL 1

Expert Comment

by:chualk
ID: 1433377
Oops :

I left out 1 thing.
Replace the code with this:



     Private Sub MDI_MNUFILE_Click()
         
            Dim count As Integer
            Dim form as new frmNewNotePad


            count = Printer.FontCount
            index = (index + 1) Mod count

           Load form
           form.Show
           form.Caption = Printer.Fonts(index)
           form.RichTextBox1.Font = Printer.Fonts(index)


     End Sub

0
 

Author Comment

by:Millos
ID: 1433378
Thanks Chualk's.  I do have one question:  I get a compile error "method or Data not Found" when I run the program and create new Child Notepad.  The line that it highlights is the following:

            Form.RichTextBox1.Font = Printer.Fonts(index)

The word .RichTextBox1 is highlighted in Yellow.
Do I have to declare RichTextBox1 anywhere or put a text box named richtextbox1?

Thanks!!
0
 
LVL 1

Expert Comment

by:chualk
ID: 1433379
Hi:

RichTextBox is a control. You can add it by go to project-> component. There you will see a control named richtextbox. It is a control similar to textbox but it's special in its ability to format text into different fonts, size and style. For detail, please read the help file.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month12 days, 9 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question