473,396 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Had a question about the menustrip

Alright, here goes...When I put a menu strip on the windows form I can
double click the exit button to go to the source page and it takes me to the
on click exit blah blah blah and you would put Application.Exit(); Alright
well what would I put for the print preview and the print and Save and
saveas and open and new? I can't find anything for these. I am new at this
and I am sure I am not going in the correct order to learn this stuff but I
like jumping around and learning things before I should. Anyways can anybody
help me out? I hope everybody could understand that correctly.

May 23 '07 #1
2 3884


May 23 '07 #2
On Tue, 22 May 2007 21:18:38 -0700, Kool-Aide <ko*********@gmail.com>
wrote:
Alright, here goes...When I put a menu strip on the windows form I can
double click the exit button to go to the source page and it takes me to
the on click exit blah blah blah and you would put Application.Exit();
Alright well what would I put for the print preview and the print and
Save
and saveas and open and new? I can't find anything for these.
Exiting an application is easy, as you've found. With a single call to a
single method, you can convey to .NET what it is you want to do.

But all that other stuff? You can't save unless .NET knows what to save.
Likewise print and print preview.

The short answer for saving is that you need to figure out what data you
need to save in your application, and how you want to store it on the
disk. You also need to decide whether you want to use the built-in
serialization mechanisms or implement the whole thing yourself.
Fortunately, both are relatively simple in most cases. But you do need to
learn about things like serialization and file i/o.

The short answer for printing and print preview is that first you need an
idea of what you want your data to look like when printed. If all you
want is to print a copy of your form, it could be as simple as just using
the Control.DrawToBitmap() method to create an in-memory copy of the form,
and then using the Graphics.DrawImage() method to actually draw that to
the Graphics instance you get from the printing API. If you want the
print-out of your data to look different than that, then you need to learn
more about the Graphics class. At a minimum it's likely you'll want to
look at DrawString(), and you may find the other "Draw..." and "Fill..."
methods useful as well.

Once you know how you're going to draw things for your printing, you need
to learn about the System.Drawing.Printing namespace, which includes
things like the PrintDialog class (for displaying a print dialog), the
PrintDocument class (for defining how a document will be printed...it's
important to note that this class is not a document itself, it's just the
class used to print documents), and the various properties, methods, and
events associated with those classes (most importantly, the
PrintDocument.Print() method and the PrintDocument.PrintPage event).

I recommend that when you start trying to learn about printing, you make
sure you have some sort of virtual print driver installed. You can get
printer drivers that create PDF files, or if you have Microsoft Office it
comes with a printer driver that will create TIFF files. Doing your
printing to some kind of electronic image format will save you a lot of
paper as you figure things out. :)

Once you've got printing working, you can look at the PrintPreviewDialog
and PrintPreviewControl classes, which will allow you to reuse your
existing print functionality in a way that displays it on-screen instead
of sending the output to a printer.

Note that the printing functionality is probably one of the most
complicated things you'll run into at the moment. .NET makes it quite a
bit simpler than trying to do it under the native Windows API (mainly
because .NET has a well-defined callback mechanism via events that all
..NET programmers are already familiar with, whereas the similar mechanism
in Windows is not something even all Windows programmers run into), but
there are still lots of little things unique to printing that come up.
But the basic concepts aren't too hard.
I am new at this
and I am sure I am not going in the correct order to learn this stuff
but I like jumping around and learning things before I should. Anyways
can anybody help me out? I hope everybody could understand that
correctly.
Jump around if you like. Just recognize that it may take longer that
way. :)

For what it's worth, I'd recommend learning how to implement your document
type in your application, whatever that may be, before you move on to the
other stuff. Once you know how your internal document data structures are
going to look, you can do a better job thinking about how the data will
look when it's on some streaming storage (for example, written to a file
on a disk).

You may be able to implement a full-functional document using only the
built-in .NET controls. And if you do so, you can even limit yourself to
just printing the form as it appears on the screen. However, eventually
you're going to want to go beyond that, and for that you need to know how
the Graphics class works. I'd recommend that you learn how to use the
Paint event in a custom control to draw your own graphics to the screen
before getting into the printing stuff. For one, the PrintPage event
works in a manner very similar to the Paint event for forms. So if you've
already figured out how to deal with the Paint event, it's an easy
transition to write a handler for the PrintPage event. And of course,
learning the various Graphics class members required to draw custom
graphics to the screen will prepare you well for drawing to the Graphics
instance that the PrintPage event gives you.

So there's your syllabus. Go for it. :)

Pete

>

May 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alvo von Cossel I | last post by:
hi, i have a modern looking application without the cotrolbox-bar because i've created my own. i have a restore down button with an image that has a grey background. if the user has a different...
0
by: rellik | last post by:
Hi All, I've run into a problem with the MenuStrip control and any help would be greatly appreciated! The problem I've got is that when use a control derived from the MenuStrip class all MDI...
0
by: academic | last post by:
Using ToolStripManager.Merge(ToolStrip,ToolStrip) I've been able to merge a MenuStrip into a MenuStrip but never a ContextMenuStrip into a MenuStrip. From the docs it seems to me I should be...
0
by: genojoe | last post by:
Included below are four methods and a Friend that can be inserted directly into a form that already contains Button1, Button2, and MenuStrip1. Button1 populates the MainMenu control, button2...
0
by: Chris Peeters | last post by:
Hi, I have an MDI-application running with 1 MDI chilld showing in 'Normal'-WindowState, so NOT maximized. What I see is the MDI-main window showing its title bar, below that the menustrip with...
0
by: active | last post by:
For the last 3 or 4 days I've been, on an off, searching the Internet and theVS2005 Doc for an example of how to add a contextmenustrip to a menustrip. I can move all the items from a...
3
by: Gav | last post by:
I am using a MenuStrip on a form and adding a Panel to the same form in the program. When the Panel is added the top of the Panel is behind the MenuStrip, so the top of the Panel is hidden. How do...
0
by: kyungdongkim | last post by:
Hi, I have a dynamically generated MenuStrip following this example: http://www.codeproject.com/useritems/Dynamic_MenuStrip.asp Basically the menu strip allows users to save and load reports. ...
3
by: ssknov | last post by:
hi i am creating a login page.Inthe form load itself i need to hide the MenuStrip in MDI Parent to HIDE, When the users gives the correct passwd and pushes the Loginbutton , My MDIParent1 forms...
1
by: Alexander Vasilevsky | last post by:
How placing text in MenuStrip, glued it to the right side MenuStrip? http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas discount
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.