Simple printing?

Printing of multiple TextBoxes

Page 1 of 1

7 Replies - 4384 Views - Last Post: 07 January 2010 - 11:20 AM Rate Topic: -----

#1 DanYell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 24-December 09

Simple printing?

Posted 28 December 2009 - 04:40 AM

DanYell,
Firstly thank you for the welcome OliveOyl3471 and PsycoCoder

What I need to know is, can anybody point me in the right direction please?

I am using Visual Basic 2008 Express Edition. I have cobbled together a small application which is in two sections. The first part can be used to calculate Value Added Tax and or Profit, both Plus and Minus ( I still have to add some error catching to it though)
This part consists of a textbox Input for the Vat / Profit rate and another for the amount to be worked out. Two other read only Textboxes to show the Vat / Profit total and the other to show the balance, either Plus or Minus the Vat / Profit. There are three buttons Plus, Minus and Clear boxes. I have made the Vat rate textbox retain the figure inside the TextBox on shutdown

The second part can hold twelve monthly sets of information for the user, to see if they have to register ( by Law)
The information is held in three columns with twelve TextBoxes in each plus a further input TextBox for each column. The columns are Year, Month and Amount. Apart from the input entry TextBoxes, all are read only. There are also a further five Textboxes. One for the registration total Input, one each for the eleven and the twelve month totals. One for the maximum amount that can be banked before going over the registration limit and a final Do You Have To Register - Yes or No TextBox
I have set it up so that each record is moved upward and overwrites any value or text in the one above it, until all twelve are filled. As further records are added the oldest is automatically deleted from the top textboxes. All of these textboxes have been set up to retain the values contained in them on shutdown ( a very useful function for this particular application )

So here at last is my question.

Is there an easy way to print the Forty One textboxes, as they appear on the screen?.
They will easily fit onto one page. I only need the information that the textboxes hold.

As an aside, I do have a slight problem with taking in the detailed instructions from the Microsoft sites, as they seem to have been written by people who specialise in technobabble. I’m more a hands on person and my way is to copy code into Word and try to read it and work out what is happening. This doesn’t always work as I don’t yet know what all the calls are.

I just had a quick look at PsycoCoders tutorial and have now amended my question

Sorry for the ramble. The question is now……….

Is there an easier way to print the Forty One textboxes, as they appear on the screen ?.

Is This A Good Question/Topic? 0
  • +

Replies To: Simple printing?

#2 billyboy630  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 94
  • Joined: 09-October 09

Re: Simple printing?

Posted 28 December 2009 - 06:51 PM

View PostDanYell, on 28 Dec, 2009 - 03:40 AM, said:

DanYell,
Firstly thank you for the welcome OliveOyl3471 and PsycoCoder

What I need to know is, can anybody point me in the right direction please?

I am using Visual Basic 2008 Express Edition. I have cobbled together a small application which is in two sections. The first part can be used to calculate Value Added Tax and or Profit, both Plus and Minus ( I still have to add some error catching to it though)
This part consists of a textbox Input for the Vat / Profit rate and another for the amount to be worked out. Two other read only Textboxes to show the Vat / Profit total and the other to show the balance, either Plus or Minus the Vat / Profit. There are three buttons Plus, Minus and Clear boxes. I have made the Vat rate textbox retain the figure inside the TextBox on shutdown

The second part can hold twelve monthly sets of information for the user, to see if they have to register ( by Law)
The information is held in three columns with twelve TextBoxes in each plus a further input TextBox for each column. The columns are Year, Month and Amount. Apart from the input entry TextBoxes, all are read only. There are also a further five Textboxes. One for the registration total Input, one each for the eleven and the twelve month totals. One for the maximum amount that can be banked before going over the registration limit and a final Do You Have To Register - Yes or No TextBox
I have set it up so that each record is moved upward and overwrites any value or text in the one above it, until all twelve are filled. As further records are added the oldest is automatically deleted from the top textboxes. All of these textboxes have been set up to retain the values contained in them on shutdown ( a very useful function for this particular application )

So here at last is my question.

Is there an easy way to print the Forty One textboxes, as they appear on the screen?.
They will easily fit onto one page. I only need the information that the textboxes hold.

As an aside, I do have a slight problem with taking in the detailed instructions from the Microsoft sites, as they seem to have been written by people who specialise in technobabble. I’m more a hands on person and my way is to copy code into Word and try to read it and work out what is happening. This doesn’t always work as I don’t yet know what all the calls are.

I just had a quick look at PsycoCoders tutorial and have now amended my question

Sorry for the ramble. The question is now……….

Is there an easier way to print the Forty One textboxes, as they appear on the screen ?.

You want Visual Basic Power Packs, it has a VERY simple printing solution. You can print your screen as you see it very easily no matter what is on it, even has a print preview. Be careful which version you use. Power Packs 3 does NOT support windows 2000, so if you think any potential users of your program will have windows 2000, use Power Packs 2 which will support Win 2000 and XP and I beleive Vista, not sure about 7. (Alot of business users still use 2000)

There is a video tutorial on the MSDN webite for Power Packs its extremly easy to use. A little tip I did i had a few things on my screen i didnt want to print so just before i called the print function i made those items invisible and then re-showed them after printing is done
Was This Post Helpful? 0
  • +
  • -

#3 DanYell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 24-December 09

Re: Simple printing?

Posted 29 December 2009 - 06:47 AM

View Postbillyboy630, on 28 Dec, 2009 - 05:51 PM, said:

View PostDanYell, on 28 Dec, 2009 - 03:40 AM, said:

DanYell,
Firstly thank you for the welcome OliveOyl3471 and PsycoCoder

What I need to know is, can anybody point me in the right direction please?

I am using Visual Basic 2008 Express Edition. I have cobbled together a small application which is in two sections. The first part can be used to calculate Value Added Tax and or Profit, both Plus and Minus ( I still have to add some error catching to it though)
This part consists of a textbox Input for the Vat / Profit rate and another for the amount to be worked out. Two other read only Textboxes to show the Vat / Profit total and the other to show the balance, either Plus or Minus the Vat / Profit. There are three buttons Plus, Minus and Clear boxes. I have made the Vat rate textbox retain the figure inside the TextBox on shutdown

The second part can hold twelve monthly sets of information for the user, to see if they have to register ( by Law)
The information is held in three columns with twelve TextBoxes in each plus a further input TextBox for each column. The columns are Year, Month and Amount. Apart from the input entry TextBoxes, all are read only. There are also a further five Textboxes. One for the registration total Input, one each for the eleven and the twelve month totals. One for the maximum amount that can be banked before going over the registration limit and a final Do You Have To Register - Yes or No TextBox
I have set it up so that each record is moved upward and overwrites any value or text in the one above it, until all twelve are filled. As further records are added the oldest is automatically deleted from the top textboxes. All of these textboxes have been set up to retain the values contained in them on shutdown ( a very useful function for this particular application )

So here at last is my question.

Is there an easy way to print the Forty One textboxes, as they appear on the screen?.
They will easily fit onto one page. I only need the information that the textboxes hold.

As an aside, I do have a slight problem with taking in the detailed instructions from the Microsoft sites, as they seem to have been written by people who specialise in technobabble. I’m more a hands on person and my way is to copy code into Word and try to read it and work out what is happening. This doesn’t always work as I don’t yet know what all the calls are.

I just had a quick look at PsycoCoders tutorial and have now amended my question

Sorry for the ramble. The question is now……….

Is there an easier way to print the Forty One textboxes, as they appear on the screen ?.

You want Visual Basic Power Packs, it has a VERY simple printing solution. You can print your screen as you see it very easily no matter what is on it, even has a print preview. Be careful which version you use. Power Packs 3 does NOT support windows 2000, so if you think any potential users of your program will have windows 2000, use Power Packs 2 which will support Win 2000 and XP and I beleive Vista, not sure about 7. (Alot of business users still use 2000)

There is a video tutorial on the MSDN webite for Power Packs its extremly easy to use. A little tip I did i had a few things on my screen i didnt want to print so just before i called the print function i made those items invisible and then re-showed them after printing is done

Was This Post Helpful? 0
  • +
  • -

#4 DanYell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 24-December 09

Re: Simple printing?

Posted 29 December 2009 - 06:58 AM

View PostDanYell, on 29 Dec, 2009 - 05:47 AM, said:

View Postbillyboy630, on 28 Dec, 2009 - 05:51 PM, said:

View PostDanYell, on 28 Dec, 2009 - 03:40 AM, said:

DanYell,

You want Visual Basic Power Packs, it has a VERY simple printing solution. You can print your screen as you see it very easily no matter what is on it, even has a print preview. Be careful which version you use. Power Packs 3 does NOT support windows 2000, so if you think any potential users of your program will have windows 2000, use Power Packs 2 which will support Win 2000 and XP and I beleive Vista, not sure about 7. (Alot of business users still use 2000)

There is a video tutorial on the MSDN webite for Power Packs its extremly easy to use. A little tip I did i had a few things on my screen i didnt want to print so just before i called the print function i made those items invisible and then re-showed them after printing is done


Thank you BillyBoy630
I will take a look at what you suggest. I am running Window 7 on this machine although I do have another running XP. I realy am new to this so it may take a while before I let you know the true result. Once again many thanks. DanYell
Was This Post Helpful? 0
  • +
  • -

#5 DanYell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 24-December 09

Re: Simple printing?

Posted 05 January 2010 - 05:28 AM

A second Thank You BillyBoy630
I managed to get it to print the information, as you suggested it could.
It worked wih Windows 7.
I was interested in your comment about making certain parts of the form invisible.
Will this be just the contents of the Textboxes , the Textboxes themselves or the Form itself ?
I would if possible like to make the form invisible, retaining just the informaion.
I would appreiciate it if you had any further information on this.
Once again many thanks.
DanYell
Was This Post Helpful? 0
  • +
  • -

#6 billyboy630  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 94
  • Joined: 09-October 09

Re: Simple printing?

Posted 05 January 2010 - 01:31 PM

Glad it workd and to be of help,

I am not sure if you can make the form invisble? Or for that matter why you would even want too.
If your concerened about it printing the forms background color which is what I suspect you are because thats what I was concerened with.
You can simply change the background color of the form to white :) print then change color back to control color

I also had some textboxes I didnt want to be printed so I just made those invisible then printed then made them visible. you can really maniuplate it pretty easily just play around it with it.

If you need some help with code let me know
Was This Post Helpful? 0
  • +
  • -

#7 DanYell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 24-December 09

Re: Simple printing?

Posted 07 January 2010 - 06:49 AM

If your concerened about it printing the forms background color which is what I suspect you are because thats what I was concerened with.
You can simply change the background color of the form to white :) print then change color back to control color

I also had some textboxes I didnt want to be printed so I just made those invisible then printed then made them visible. you can really maniuplate it pretty easily just play around it with it.

If you need some help with code let me know
[/quote]

BillyBoy630
The code to help me with hiding sections of the form would be of considerable help. I would really appreciate it if you could give me an idea of how to do this.
Once again, Many Thanks
DanYell
Was This Post Helpful? 0
  • +
  • -

#10 billyboy630  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 94
  • Joined: 09-October 09

Re: Simple printing?

Posted 07 January 2010 - 11:20 AM

Here is code I use in my project, you should be able to adjust it to your needs. if you need more help just let me know

Public Sub Printpage1()
		Me.ActiveControl = Nothing 'this removes the cursor
		Me.BackColor = Color.White 'this makes form white instead of grey
		Me.MenuStrip1.Visible = False 'hides my menu strip
		Me.selectlistings.Visible = False 'hides a button
		Me.selectSolds.Visible = False 'hides a button
		Me.print.Visible = False 'hides a button
		For Each ctrl As Control In Me.Controls
			If TypeOf ctrl Is TextBox Then
				CType(ctrl, TextBox).BackColor = Color.White 
			ElseIf TypeOf ctrl Is ComboBox Then
				CType(ctrl, ComboBox).BackColor = Color.White
			End If
		Next
		Me.Refresh()
		Me.PrintForm1.PrinterSettings.DefaultPageSettings.Landscape = True
		Me.PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Top = 60
		Me.PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Bottom = 60
		Me.PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Right = 30
		Me.PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Left = 30
		PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
		PrintForm1.Print()
		Me.MenuStrip1.Visible = True
		Me.selectlistings.Visible = True
		Me.selectSolds.Visible = True
		Me.print.Visible = True
		Me.BackColor = SystemColors.Control()
		For Each ctrl As Control In Me.Controls
			If TypeOf ctrl Is TextBox Then
				CType(ctrl, TextBox).BackColor = ctrl.BackColor
			ElseIf TypeOf ctrl Is ComboBox Then
				CType(ctrl, ComboBox).BackColor = ctrl.BackColor
			End If
		Next
	End Sub

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1