mohamed222222
Messages postés161Date d'inscriptionmardi 12 juin 2007StatutMembreDernière intervention22 avril 2009
-
14 nov. 2008 à 17:26
mohamed222222
Messages postés161Date d'inscriptionmardi 12 juin 2007StatutMembreDernière intervention22 avril 2009
-
17 nov. 2008 à 10:52
Bonjour,
Dans mon interface je charge un datagridview que je nomme datgridview1. Ensuite je souhaiterai affecté les valeurs de ce datagridview1 à un autre datagridview que je nomme datagridview2. Pour cela je fais :
dim datagrdiview2 as datagridview
datagrdiview2=datagrdiview1
Cela marche bien par contre quand je modifie une propriété du datagridview2 il modifie automatiquement celui du datagridview1.
Comment faire fasse à ce problème ?
If m_ctrl.Columns("Solder").Visible = True Then
colonneVisible = True
m_ctrl.Columns("Solder").Visible = False
m_ctrl.Columns("Reessayer").Visible = False
End If
Dim printwidth As Integer = width
Dim printheight As Integer = height
If printwidth > e.MarginBounds.Width Then
printheight = CInt(Fix((CSng(e.MarginBounds.Width) / CSng(printwidth)) * printheight))
printwidth = e.MarginBounds.Width
End If
If printheight - printedheight > e.MarginBounds.Height Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
Dim longueur As Integer = 0
Dim gp As GraphicsUnit = GraphicsUnit.Display
Dim b As New Bitmap(width, height)
m_ctrl.DrawToBitmap(b, New Rectangle(0, 0, width, height))
Dim ScaleF As Single = CSng(height) / CSng(printheight)
printheight -= printedheight
If printheight > e.MarginBounds.Height Then
printheight = e.MarginBounds.Height
End If
Dim rect As New Rectangle(0, CInt(Fix(printedheight * ScaleF)), b.Width, CInt(Fix(printheight * ScaleF)))
Dim b2 As Bitmap = b.Clone(rect, System.Drawing.Imaging.PixelFormat.DontCare)
e.Graphics.DrawImage(b2, 40, position + 40, printwidth, printheight)
If e.HasMorePages Then
printedheight += e.MarginBounds.Height - inbetween
Else
printedheight = 0
End If
e.Graphics.DrawString(Now.ToString, New Font("Arial", 6, FontStyle.Italic), Brushes.Black, 1000, 750)
e.Graphics.DrawString(Page.ToString, New Font("Arial", 6, FontStyle.Italic), Brushes.Black, 600, 750)
If colonneVisible = True Then
m_ctrl.Columns("Solder").Visible = True
m_ctrl.Columns("Reessayer").Visible = True
End If
m_ctrl.Size = New Size(OldSize.Width, OldSize.Height)
m_ctrl.Dock = OldDock
End Sub
Par contre je change la propriété de mon datagridview car je ne souhaite pas imprimer toutes les colonnes de mon datagridview.