[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

MDI NotePad Program

Posted on 1998-04-28
4
Medium Priority
?
373 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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

650 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