473,654 Members | 3,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Exi t(); 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 3898


May 23 '07 #2
On Tue, 22 May 2007 21:18:38 -0700, Kool-Aide <ko*********@gm ail.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.Exi t();
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.DrawToB itmap() method to create an in-memory copy of the form,
and then using the Graphics.DrawIm age() 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.P rint() method and the PrintDocument.P rintPage 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 PrintPreviewDia log
and PrintPreviewCon trol 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
5480
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 XP style then the button will look weird. how can i make the menustrip not change colour when the user of the PC changes their XP style? -- Alvo von Cossel I of Germany
0
1842
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 merge functionality breaks - each MDI child window is given it's own menu rather than the mdi parent. To repeat the problem just create a very simple dummy app that has standard
0
2369
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 able to.
0
2960
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 populates the MenuStrip control. The MainMenu is from legacy 2003 and works fine. I want to upgrade to the MenuStrip but cannot find a way to duplicate legacy code. Shown below is my best effort. I am having two problems. #1: ToolStripMenuItem...
0
1652
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 merged-menuitems and the MDI-child window 'floating' within the MDI-container just showing an icon + title in its title bar. So far so good. But when I maximize the MDI-child window ... what i see then is the
0
1714
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 contentmenustrip to a menustrip, but what I need to do is have the items in both places. I did see where it was said that a contexmenu can be used in multiple places. But I wonder if that means that multiple controls can reference the same contextmenustrip....
3
2739
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 I make the Panel I have added appear below the MenuStrip? Is it something to do with the MenuStrip, is it floating? Gav
0
5040
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. The Load menu is to list all the saved reports. I need to refresh the Load menu after a new report is saved. Any help is much appreciated! Code:
3
6569
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 menustrip should be visible . c my code . but it doesnt works. Any body pls clear my doubt. private void LoginForm_Load(object sender, EventArgs e) {
1
2357
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
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8482
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.