Click here to Skip to main content
15,904,653 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni25-Jan-16 22:52
Dorsaf Ouersighni25-Jan-16 22:52 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Sascha Lefèvre25-Jan-16 23:00
professionalSascha Lefèvre25-Jan-16 23:00 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni25-Jan-16 23:33
Dorsaf Ouersighni25-Jan-16 23:33 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Sascha Lefèvre26-Jan-16 0:06
professionalSascha Lefèvre26-Jan-16 0:06 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 1:36
Dorsaf Ouersighni26-Jan-16 1:36 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Sascha Lefèvre26-Jan-16 2:03
professionalSascha Lefèvre26-Jan-16 2:03 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 2:44
Dorsaf Ouersighni26-Jan-16 2:44 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Sascha Lefèvre26-Jan-16 4:01
professionalSascha Lefèvre26-Jan-16 4:01 
I'm guessing that the infinite looping doesn't occur within the posted Sub. Instead, I assume, e.HasMorePages always gets set to true so that the PrintPage-event automatically gets fired again so the Sub gets called again. You can verify this by placing a debug-breakpoint on this line:
VB
If bMorePagesToPrint Then
When you get there, inspect the value of bMorePagesToPrint (I suspect it will always be true) and then press F5 (continue execution until next breakpoint) which will probably get you to that same line again and again.

If this is the case, then the condition on this line
VB
If (iTopMargin + (iCellHeight >= (e.MarginBounds.Height + e.MarginBounds.Top))) Then
never evaluates to false so that bMorePagesToPrint always gets set to true. Then you would have to figure out why this condition never evaluates to false - this is hard to guess for me by looking at the code only.

Dorsaf Ouersighni wrote:
By the way you have a beautiful name
Thank you Smile | :)
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 4:36
Dorsaf Ouersighni26-Jan-16 4:36 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Sascha Lefèvre26-Jan-16 4:45
professionalSascha Lefèvre26-Jan-16 4:45 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Sascha Lefèvre26-Jan-16 5:05
professionalSascha Lefèvre26-Jan-16 5:05 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 21:04
Dorsaf Ouersighni26-Jan-16 21:04 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Jörgen Andersson26-Jan-16 22:52
professionalJörgen Andersson26-Jan-16 22:52 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni27-Jan-16 2:39
Dorsaf Ouersighni27-Jan-16 2:39 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Jörgen Andersson27-Jan-16 3:22
professionalJörgen Andersson27-Jan-16 3:22 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Sascha Lefèvre26-Jan-16 2:29
professionalSascha Lefèvre26-Jan-16 2:29 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 2:48
Dorsaf Ouersighni26-Jan-16 2:48 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dave Kreskowiak26-Jan-16 2:40
mveDave Kreskowiak26-Jan-16 2:40 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 3:23
Dorsaf Ouersighni26-Jan-16 3:23 
AnswerRe: How to print a full DataGridView (Urgent) Pin
Richard MacCutchan26-Jan-16 2:28
mveRichard MacCutchan26-Jan-16 2:28 
SuggestionRe: How to print a full DataGridView (Urgent) Pin
Richard Deeming26-Jan-16 2:43
mveRichard Deeming26-Jan-16 2:43 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 3:01
Dorsaf Ouersighni26-Jan-16 3:01 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Richard MacCutchan26-Jan-16 3:02
mveRichard MacCutchan26-Jan-16 3:02 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 3:10
Dorsaf Ouersighni26-Jan-16 3:10 
GeneralRe: How to print a full DataGridView (Urgent) Pin
Dorsaf Ouersighni26-Jan-16 2:58
Dorsaf Ouersighni26-Jan-16 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.