473,698 Members | 2,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Print contents of WindowsForms UserControl

2 New Member
I have a win forms application (c#) that has a UserControl containing many labels and text boxes.
I want to select the labels and textboxes from that UserControl and print only the selected items When a Print command is issued.
Can anyone tell me how I can do that.

I am using the following code to get access to each of the controls,

Expand|Select|Wrap|Line Numbers
  1. foreach (Control ctrl in objCtrl.Controls)
  2. {
  3.  
  4. }
  5.  
Thanks in advance
Apr 19 '07 #1
0 840

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5662
by: David Smith | last post by:
My app has a base Form class, called FunctionForm, from which all forms inherit. This worked fine last week, when I was using VS.NET 2005 Pro but this week, while using VS.NET 2005 Team System Developer, I get the following while working in the designer. The form compiles and runs fine, but I can't design it. Firstly, is the stack trace the LoaderExceptions property? Secondly, how do I approach a work around? Unable to load one or more...
1
1019
by: PHether | last post by:
SO, I have a WindowsForms based Usercontrol being hosted in a ASP.NET page using the <object> tag method. What I am trying to do now is have that control access the Session object of the ASP.NET page. If possible I would like to be able to do this without having to use the <param> tags to pass data into the usercontrol. Is this possible? Thank You,
1
2079
by: Max2006 | last post by:
Hi, I have a user control that shows the contents of potentially big html files. To save the server memory, I try to avoid reading the whole large-file's text into a label or literal control. Therefore, I tried to use this code in the user control's code behind:
1
1182
by: Mike P | last post by:
Does anybody have a simple example of using the classes in the System.Data.OleDb namespace to access the contents of the a csv file as a data set? *** Sent via Developersdex http://www.developersdex.com ***
9
4874
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how can I print out this content to printer easily? Thanks! James
3
2791
by: =?Utf-8?B?R3JlZyBN?= | last post by:
Hello, I'm running an asp.net, intranet web application using .net framework 1.1 on IIS5.1 / 6.0. Through the web application, I would like to press a button on the web page, have another window (not web-based or part of current application) brought to the front and focused (findwindow api) and have the button scrape the contents of the focused window so the contents can be parsed and entered into the web application. Ideally, I would...
6
1987
by: John Kotuby | last post by:
Hi all, I am using a 3rd party program in a VS2005 web project. The tool takes as input a string containing HTML and converts it to RTF. I have been creating a page by dynamically loading UserControls and then sending the page to the browser. Now I want to write the contents of the the page to a string variable, convert that variable to the RTF and send that to the browser and I am stuck on the "simple" part of getting the contents of...
3
5512
by: Simon Verona | last post by:
Sorry for the repost, but this group seems to be more "active" than the group that I posted my question, and it's probably as valid here as there! I have a usercontrol, which contains a textbox (as well as other controls). The textbox is set for multiline, so it *should* accept an Enter Key to move down to the next line. However, I'm finding that if I put the control onto a form which has a default Accept button set, then pressing...
14
2223
by: jehugaleahsa | last post by:
I have a rather complex need. I have a class that parses web pages and extracts all relevant file addresses. It allows me to download every pdf on a web page, for instance. I would like to incorporate threads so that I can download N files separately. The obvious solution is a thread pool. However, I need to make sure that I download the files Async - so I can get percentage and status information to my interface.
0
8678
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
8609
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,...
0
9166
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8899
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
7737
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...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
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
4371
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...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.