How to print the content of the form such as flexigrid only or frame only?

How to print the content of the form such as flexigrid only or frame only?

I've been trying how solve my problem. I have developed a school system (schedule for school/teacher/student), I'm already there, but stuck in printing the schedule.

What I want is to print (to the printer) the schedule that I developed using flexigrid include the grid and color (like print screen) but this time is only flexigrid...

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Check out this Microsoft KB article...

HOWTO: Capture and Print the Screen, a Form, or any Window

You can use the routines here to capture the grid and print it...

Warning, it is kinda complicated code...


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Printer.PaintPicture MSFlexGrid1.Picture, 0, 0
Printer.PaintPicure will work as suggested by Erick37 but if you don't have enough memory to print in color mode, change the MSFlexGrid to mono mode before send it to the Printer Object.  If you need color you have to have lots of memory.

I have 128MB on my machine and it still won't print color MSFlexGrid (at least in the IDE mode, haven't tried in the compiled exe version)
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

saltacidAuthor Commented:
Thank you so much,
I need further explanation .... if my flexigrid contains multi-colors, do I have to code it or it will automatically recognized the color when I use Printer.PaintPicture ?

since I haven't been able to print color MSFlexGrid myself (and b/w will do for my project), I cannot give you a definite answer.

However, I am 80% sure that the Printer object prints what you send to it without modifiying it, so it should print a color image.

I am guessing may be the part that you don't understand is the MSFlexGrid's picture.  It is like a screen capture except it captures exactly what you see for the MSFlexGrid only.  

NOTE:  it does not print what you can't see.

Why don't you try to print a small color sample grid and see how it works?
saltacidAuthor Commented:
I have tried printing the content of MSFlexigrid...but currently I did manage to print on normal laser printer.

On my MSFlexigrid, I put several colors in order to differentiate
the dark and bright when I print on the normal printer(non color printer), and it worked.

Eventhough it's black and white, but the brightness and darkness of the color show the differences.

(reply to leesss)
And you say "it does not print what you can't see" is not true if you mean if there is scrolls exist. (probably you mean something else"

I have created MSFlexigrid with two scroll bars (vert. and hor.)
and it printed all the contents of the MSFlexigrid without scroll bars printed.

eg. If I create 5 columns and 5 rows, and the size of the MSFlexigrid is only shows 1 row and 2 columns, but when I use
command :-
      Printer.PaintPicture MSFlexgrid1.Picture,0,0

     It will print the whole 5 columns and 5 rows perfectly.

Good for you.  So everything is resolved?

Good point about the scroll bars.  Mine didn't have them, but I didn't need them so I never tried them.  If your column width is smaller than your text so that not all your text is visible, and you use the picture to print, you won't see the text.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.