Devenir membre club
Connectez vous
Aide & règlement
Votre 1ère visite
Le règlement
Contacter les admins
Contacter le webmaster
Questions & réponses
Comment soutenir CodeS-SourceS
Comment faire un lien vers CodeS-SourceS
Autres questions
A propos & don
A propos du réseau
Les modérateurs
Remerciements
Faire un don
Le livre d'or
Tous les livres
Les dernières parutions
Les plus consultés
Les critiques
Le top des ventes
Le top favoris des membres
Recevoir des livres blancs
Tous les thèmes
Les derniers messages
Les nouveaux messages
Poser une question
Le Chat - IRC
Tous les tutoriels
Ajouter un tutoriel
Les tutoriels en vidéo
Les formations vidéos
Tous les codes
Ajouter un code
Filtrer par catégorie
Filtrer par date
Les plus récents
Les mis à jour
Les codes par jour
Filtrer par niveau
Niveau débutant
Niveau initié
Niveau expert
Filtrer par type
Les codes avec capture
Les codes avec zip
Les codes .Net
Filtrer par qualité
Les plus populaires
Les plus populaires du mois
Les plus téléchargés
Les mieux notés
Top par catégorie
Top des favoris
Filtrer par auteur
Tous les auteurs
Le top des membres
Les snippets
Déposer votre CV
Consulter les offres d'emploi ou de stage
Consulter les CVs
Déposer une offre d'emploi ou de stage
Modèles de CV et lettres
Trouver une convention collective
Les écoles d'informatique
Toutes les écoles
Ajouter une école
Les outils
Outils pour développeurs
Trouver des ressources
Base de données de CodeS-SourceS
Télécharger les meilleurs logiciels
Comparer les prix
Envoyer des ecards
Création de bannières
Annuaire de la prog
Tous les sites
Ajouter votre site
Le dico de la prog
Toutes les définitions
Ajouter une définition
Les évènements
Tous les évènements
Les évènements à venir
Ajouter un évènement
Téléchargements
CodeS-SourceS Toolbox
CodeS-SourceS Toolbar
Toolbar pour FireFox
Fonds d'écran
Les compil's
Nos partenaires
Magazine Programmez
Frontier.fr
Xiti
ProgOnline
Winwise
Editions Eyrolles
Toute la liste
Les RFC
CS
VB, VB.NET
ASP.NET,ASP
C, C++
ColdFusion
PHP
Javascript
Delphi
Flash
Java
Graphisme
Irc
Assembleur
C#
Mobilité
SQL
Foxpro
Python
Regex
Flex
Windev
Ce site au démarrage
begin process at 2012 02 12 20:00:09
Accueil
Codes
Tutoriels
Forum
Livres
Emploi
Services
Connexion
Trouver un code source :
dans
Tout le site
Codes
Tutoriels
Forum
Blogs
Livres
RFC
Icones
News .NET
Boutique
[ Dernières recherches ]
Veuillez saisir votre recherche... Ex: smtp, lire un fichier, rs232
Options de recherche :
Tous les codes
Tous les codes en .Net
Tous les codes sauf .Net
Langages disponibles :
Tous les langages
ASP / ASP.NET
Assembleur
C / C++ / C++.NET
C# / C#.NET
ColdFusion
Delphi
Flash
Flex, Air, ActionScript
Foxpro
Graphisme
IRC
JAVA / J2EE
Javascript / Ajax / DHTML
PDA / PocketPC
PHP
Python
Regex, Regular Expression, Expression régulière
SQL
Visual Basic, VB6, VB.NET, VB 2005, VB
7 commentaire(s) de dedebatou
sur des sources sur tout
CodeS-SourceS
Déposé sur
Courbe 2d sans mschart
Voici le module Graph.vb corrigé pour accepter les valeurs négatives:
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class graph
Public chartdata(0, 0) As Object
Public CourbeVisible(100) As Boolean
Public barVisible(100) As Boolean
Public CurseurVisible(100) As Boolean
Public ValeurMoyenne(100) As Boolean
Public PenCourbe(100) As Pen
Public Image As Bitmap
Private PenAxe As New Pen(Color.Black, 2)
Private PenGrill As New Pen(Color.Gray, 0)
Private BrushTitre As Brush = Brushes.Black
Private Bcolor As Color = Color.White
Private ombre As Color = Color.LightGray
Private ovisible As Boolean = True
Private Penombre As New Pen(Color.LightGray, 2)
Private colorgrill As Color = Color.Gray
Private colortitre As Color = Color.Black
Private coloraxe As Color = Color.Black
Private BcolorGrill As Color = Color.White
Private FontY As Font = New System.Drawing.Font("MicrosoFontTitre Sans Serif", 8.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Private FontX As Font = New System.Drawing.Font("MicrosoFontTitre Sans Serif", 8.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Private FTitre As Font = New System.Drawing.Font("MicrosoFontTitre Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Private titre As String = "Titre"
Private naxex As String = ""
Private naxey As String = ""
Private mb As Integer = 100
Private mh As Integer = 40
Private ml As Integer = 50
Private ex As Integer
Private ey As Integer
Private ny As Integer
Private gg As Graphics
Private orientX As Boolean
Private nbc As Integer = 2
Private nbe As Integer = 1000
Private rcontrole As Rectangle
Private rgraph As Rectangle
Private pvisible As Boolean = True
Private zoom As Boolean
Private ccontour As Color = Color.Black
Private cvisible As Boolean
Private moy(100) As Double
Private vmin As Integer
Public ReadOnly Property Moyenne(ByVal n As Integer) As Double
Get
Return moy(n)
End Get
End Property
Public Property CouleurContour() As Color
Get
Return ccontour
End Get
Set(ByVal value As Color)
ccontour = value
Me.Refresh()
End Set
End Property
Public Property ContourVisible() As Boolean
Get
Return cvisible
End Get
Set(ByVal value As Boolean)
cvisible = value
Me.Refresh()
End Set
End Property
Public Property ZoomActif() As Boolean
Get
Return zoom
End Get
Set(ByVal value As Boolean)
zoom = value
End Set
End Property
Public Property NomAxeX() As String
Get
Return naxex
End Get
Set(ByVal value As String)
naxex = value
End Set
End Property
Public Property NomAxeY() As String
Get
Return naxey
End Get
Set(ByVal value As String)
naxey = value
End Set
End Property
Public Property FontAxeX() As Font
Get
Return FontX
End Get
Set(ByVal value As Font)
FontX = value
Me.Refresh()
End Set
End Property
Public Property FontAxeY() As Font
Get
Return FontY
End Get
Set(ByVal value As Font)
FontY = value
Me.Refresh()
End Set
End Property
Public Property FontTitre() As Font
Get
Return FTitre
End Get
Set(ByVal value As Font)
FTitre = value
Me.Refresh()
End Set
End Property
Public Property CouleurAxe() As Color
Get
Return coloraxe
End Get
Set(ByVal value As Color)
coloraxe = value
PenAxe = New Pen(colortitre, 2)
Me.Refresh()
End Set
End Property
Public Property CouleurTitre() As Color
Get
Return colortitre
End Get
Set(ByVal value As Color)
colortitre = value
BrushTitre = New Pen(colortitre).Brush
Me.Refresh()
End Set
End Property
Public Property NomTitre() As String
Get
Return titre
End Get
Set(ByVal value As String)
titre = value
End Set
End Property
Public Property OmbreCourbe() As Boolean
Get
Return ovisible
End Get
Set(ByVal value As Boolean)
ovisible = value
Me.Refresh()
End Set
End Property
Public Property CouleurFond() As Color
Get
Return Bcolor
End Get
Set(ByVal value As Color)
Bcolor = value
Me.Refresh()
End Set
End Property
Public Property CouleurFondGrille() As Color
Get
Return BcolorGrill
End Get
Set(ByVal value As Color)
BcolorGrill = value
Me.Refresh()
End Set
End Property
Public Property CouleurGrille() As Color
Get
Return colorGrill
End Get
Set(ByVal value As Color)
colorGrill = value
Me.Refresh()
End Set
End Property
Public Property NbCourbe() As Integer
Get
Return nbc
End Get
Set(ByVal value As Integer)
nbc = value
ReDim chartdata(nbe, value)
ReDim CourbeVisible(value)
ReDim PenCourbe(value)
End Set
End Property
Public Property NbElement() As Integer
Get
Return nbe
End Get
Set(ByVal value As Integer)
nbe = value + 1
ReDim chartdata(value, nbc)
End Set
End Property
Public Property PointVisible() As Boolean
Get
Return pvisible
End Get
Set(ByVal value As Boolean)
pvisible = value
Me.Refresh()
End Set
End Property
Private Function maxX() As Integer
Try
maxX = 1
If chartdata.GetLength(0) = 100 Then Exit Function
Dim i As Integer
For i = 1 To chartdata.GetLength(1) - 1
If Len(chartdata(i, 0)) > maxX Then maxX = Len(chartdata(i, 0))
Next
Catch ex As Exception
End Try
End Function
Private Function maxval() As Integer
Try
maxval = 0
If chartdata.GetLength(0) = 100 Then Exit Function
Dim i As Integer, j As Integer
For i = 1 To chartdata.GetLength(1) - 1
For j = 0 To chartdata.GetLength(0) - 1
If Val(chartdata(j, i)) > maxval And CourbeVisible(i) = True Then maxval = Math.Ceiling(Val(chartdata(j, i)))
If Val(chartdata(j, i)) > maxval And barVisible(i) = True Then maxval = Math.Ceiling(Val(chartdata(j, i)))
If Val(chartdata(j, i)) > maxval And CurseurVisible(i) = True Then maxval = Math.Ceiling(Val(chartdata(j, i)))
Next
Next
Catch ex As Exception
End Try
End Function
Private Function minval() As Integer
Try
minval = 0
If chartdata.GetLength(0) = 100 Then Exit Function
Dim i As Integer, j As Integer
For i = 1 To chartdata.GetLength(1) - 1
For j = 0 To chartdata.GetLength(0) - 1
If Val(chartdata(j, i)) < minval And CourbeVisible(i) = True Then minval = Math.Ceiling(Val(chartdata(j, i)))
If Val(chartdata(j, i)) < minval And barVisible(i) = True Then minval = Math.Ceiling(Val(chartdata(j, i)))
If Val(chartdata(j, i)) < minval And CurseurVisible(i) = True Then minval = Math.Ceiling(Val(chartdata(j, i)))
Next
Next
Catch ex As Exception
End Try
End Function
Private Sub Fond_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Fond.Paint
Image = New Bitmap(Fond.Width, Fond.Height)
Dim g As Graphics = Graphics.FromImage(Image)
Dim gf As Graphics = Fond.CreateGraphics
g.SmoothingMode = SmoothingMode.AntiAlias
Try
'calcul la marge droite et gauche
ml = (FontY.GetHeight * (1 + Len(CStr(maxval())))) * 1.6
'calcule de la marge basse
mb = (FontX.GetHeight + 10) * 2
'calcule marge basse si ecriture verticale
orientX = False
If (Fond.Width - (2 * ml)) / chartdata.GetLength(0) < (FontX.GetHeight * maxX() * 0.6) Then
mb = (maxX() * FontX.GetHeight * 0.5) + 10 + (FontX.GetHeight + 10)
orientX = True
End If
'dessine fond du graph
dessinefond(g)
dessgrille(g)
'dessine axe x
dessineaxe(g)
dessinebar(g)
dessinecurseur(g)
desscourbe(g)
dessinemoyenne(g)
gf.DrawImage(Image, 0, 0)
g.Dispose()
gf.Dispose()
Catch ex As Exception
End Try
End Sub
Private Sub dessineaxe(ByVal g As Graphics)
Try
PenAxe = New Pen(coloraxe, 2)
g.DrawLine(PenAxe, ml - 5, Fond.Height - mb, Fond.Width - ml + 5, Fond.Height - mb)
'dessine axe y
g.DrawLine(PenAxe, ml, mh, ml, Fond.Height - (mb - 5))
'g.DrawLine(PenAxe, Fond.Width - ml, mh, Fond.Width - ml, Fond.Height - (mb - 5))
'affiche nom axe x
g.DrawString(naxex, FontX, PenAxe.Brush, (Fond.Width - FontX.GetHeight * 0.5 * naxex.Length) / 2, Fond.Height - FontX.GetHeight - 10)
'affiche nom axe y
Dim sf As StringFormat = StringFormat.GenericTypographic
sf.FormatFlags = StringFormatFlags.DirectionVertical
g.DrawString(naxey, FontY, PenAxe.Brush, 10, (Fond.Height - mb - mh) / 2, sf)
' g.DrawString(naxey, FontY, PenAxe.Brush, Fond.Width - 10 - FontY.GetHeight, (Fond.Height - mb - mh) / 2, sf)
Catch ex As Exception
End Try
End Sub
Private Sub dessinefond(ByVal g As Graphics)
Try
rcontrole = New Rectangle(0, 0, Fond.Width, Fond.Height)
rgraph = New Rectangle(ml, mh, Fond.Width - (2 * ml), Fond.Height - mh - mb)
Dim lbrush As New LinearGradientBrush(rcontrole, Bcolor, Color.WhiteSmoke, LinearGradientMode.ForwardDiagonal)
g.FillRectangle(lbrush, rcontrole)
lbrush = New LinearGradientBrush(rgraph, BcolorGrill, Color.WhiteSmoke, LinearGradientMode.Horizontal)
g.FillRectangle(lbrush, rgraph)
Dim tp As New Pen(ccontour, 2)
If cvisible = True Then
g.DrawRectangle(tp, Math.Abs(Fond.Left), Fond.Top, Me.Width - 1, Me.Height - 1)
End If
Catch ex As Exception
End Try
End Sub
Private Sub dessgrille(ByVal g As Graphics)
Dim i As Integer, j As Integer, v As Integer, xx As Integer, yy As Integer, ec As Integer, it As Integer
Try
'affiche le titre
PenAxe = New Pen(coloraxe, 2)
ombre = Color.FromArgb(128, ombre.R, ombre.G, ombre.B)
Penombre = New Pen(ombre, PenCourbe(i).Width)
Penombre.StartCap = LineCap.Round
If ovisible = True Then g.DrawString(titre, FontTitre, Penombre.Brush, (Fond.Width / 2 - (titre.Length * FontTitre.GetHeight) / 4) + 3, 8)
g.DrawString(titre, FontTitre, BrushTitre, (Fond.Width / 2 - (titre.Length * FontTitre.GetHeight) / 4), 5)
'trouve la valeur max de l'axe y
v = maxval()
vmin = minval()
'calcule longeur des axe
xx = Fond.Width - (2 * ml)
yy = (Fond.Height - mb) - mh
'calcule echelle y
ec = ((yy) / (v - vmin))
If ec = 0 Then ec = 1
If ec < 20 Then
i = Math.Ceiling(20 / ec)
ec = ec * i
End If
it = Math.Ceiling((v - vmin) / (yy / ec))
ey = it
ny = ec
j = vmin
Dim lg As Integer
PenGrill = New Pen(colorgrill, 1)
PenGrill.DashStyle = DashStyle.Dash
For i = 0 To yy Step ec
lg = Len(CStr(j)) * (FontY.GetHeight * 0.5)
g.DrawLine(PenGrill, ml - 5, Fond.Height - mb - i, Fond.Width - ml + 5, Fond.Height - mb - i)
g.DrawString(CStr(j), FontY, PenAxe.Brush, ml - 10 - lg, Fond.Height - mb - i - (FontY.GetHeight / 2))
'g.DrawString(CStr(j), FontY, PenAxe.Brush, Fond.Width - ml + 5, Fond.Height - mb - i - (FontY.GetHeight / 2))
j = j + it
Next
'calcul echelle x
ec = Fix((xx * 100) / (chartdata.GetLength(0)))
j = 0
ex = ec
Dim mx As Integer = -1
Dim ii As Integer
For i = 0 To (xx * 100) - ec Step ec
ii = i / 100
g.DrawLine(PenGrill, ml + ii, Fond.Height - mb + 5, ml + ii, mh)
If orientX = True Then
Dim sf As StringFormat = StringFormat.GenericTypographic
sf.FormatFlags = StringFormatFlags.DirectionVertical
If ii > mx Then
g.DrawString(CStr(chartdata(j, 0)), FontX, PenAxe.Brush, ml + ii + (ec / 200) - (FontX.GetHeight * 0.5), Fond.Height - mb + 5, sf)
mx = ii + FontX.GetHeight
End If
Else
g.DrawString(CStr(chartdata(j, 0)), FontX, PenAxe.Brush, ml + ii + (ec / 200) - (FontX.GetHeight * 0.5 * (Len(chartdata(j, 0)) / 2)), Fond.Height - mb + 5)
End If
j = j + 1
Next
gg = g
Catch ex As Exception
End Try
End Sub
Private Sub desscourbe(ByVal g As Graphics)
Dim i As Integer, j As Integer, xx As Integer, yy As Integer, xx0 As Integer, yy0 As Integer, tx As Integer, tx0 As Integer
Try
For i = 1 To chartdata.GetLength(1) - 1
xx = ml * 100 + ex / 2
yy = (Fond.Height - mb) - ((chartdata(0, i) - vmin) / ey) * ny
PenCourbe(i).LineJoin = LineJoin.Round
For j = 1 To chartdata.GetLength(0) - 1
xx0 = (xx + ex)
yy0 = (Fond.Height - mb) - ((chartdata(j, i) - vmin) / ey) * ny
tx = xx / 100
tx0 = xx0 / 100
If CourbeVisible(i) = True And ovisible = True Then g.DrawLine(Penombre, tx + 7, yy + 7, tx0 + 7, yy0 + 7)
If CourbeVisible(i) = True Then g.DrawLine(PenCourbe(i), tx, yy, tx0, yy0)
xx = xx0
yy = yy0
Next
xx = ml * 100 + ex / 2
yy = (Fond.Height - mb) - ((chartdata(0, i) - vmin) / ey) * ny
If pvisible = True Then
For j = 1 To chartdata.GetLength(0) - 1
xx0 = (xx + ex)
yy0 = (Fond.Height - mb) - ((chartdata(j, i) - vmin) / ey) * ny
tx = xx / 100
tx0 = xx0 / 100
Dim bo As Brush = Brushes.LightGray
If CourbeVisible(i) = True And ovisible = True Then g.FillPie(Penombre.Brush, tx - (PenCourbe(i).Width * 2) + 7, yy - (PenCourbe(i).Width * 2) + 7, PenCourbe(i).Width * 4, PenCourbe(i).Width * 4, 0, 360)
If CourbeVisible(i) = True Then g.FillPie(PenCourbe(i).Brush, tx - (PenCourbe(i).Width * 2), yy - (PenCourbe(i).Width * 2), PenCourbe(i).Width * 4, PenCourbe(i).Width * 4, 0, 360)
xx = xx0
yy = yy0
Next
tx = xx / 100
If CourbeVisible(i) = True And ovisible = True Then g.FillPie(Penombre.Brush, tx - (PenCourbe(i).Width * 2) + 7, yy - (PenCourbe(i).Width * 2) + 7, PenCourbe(i).Width * 4, PenCourbe(i).Width * 4, 0, 360)
If CourbeVisible(i) = True Then g.FillPie(PenCourbe(i).Brush, tx - (PenCourbe(i).Width * 2), yy - (PenCourbe(i).Width * 2), PenCourbe(i).Width * 4, PenCourbe(i).Width * 4, 0, 360)
End If
Next
Catch ex As Exception
End Try
End Sub
Private Sub dessinebar(ByVal g As Graphics)
Dim i As Integer, j As Integer, v As Integer, xx As Integer, yy As Integer, tx As Integer, lb As Integer
Try
'calcule largeur bar
j = 0
For i = 1 To chartdata.GetLength(1) - 1
If barVisible(i) = True Then j = j + 1
Next
lb = ex / j
lb = lb / 100
'dessine bar
v = 0
For i = 1 To chartdata.GetLength(1) - 1
xx = ml * 100 + (lb * 100) * v
If barVisible(i) = True Then v = v + 1
ombre = Color.FromArgb(128, ombre.R, ombre.G, ombre.B)
Penombre = New Pen(ombre, PenCourbe(i).Width)
Penombre.StartCap = LineCap.Round
Dim rbar As Rectangle
For j = 0 To chartdata.GetLength(0) - 1
yy = (Fond.Height - mb) - (((chartdata(j, i) - vmin) / ey) * ny + 1)
tx = (xx / 100)
rbar = New Rectangle(tx, yy, lb / 2, Fond.Height - (yy + mb))
Dim tmpcolor As Color
tmpcolor = Color.FromArgb(64, PenCourbe(i).Color.R, PenCourbe(i).Color.G, PenCourbe(i).Color.B)
Dim tmpbrush = New LinearGradientBrush(rbar, PenCourbe(i).Color, tmpcolor, LinearGradientMode.Horizontal)
tmpbrush.WrapMode = 3
If barVisible(i) = True Then g.FillRectangle(tmpbrush, tx, yy, lb, Fond.Height - (yy + mb))
xx = xx + ex
Next
Next
Catch ex As Exception
End Try
End Sub
Private Sub dessinecurseur(ByVal g As Graphics)
Dim i As Integer, j As Integer, xx As Integer, yy As Integer, xx0 As Integer, yy1 As Integer, tx As Integer, tx1 As Integer, xx1 As Integer
Try
'dessine curseur
For i = 1 To chartdata.GetLength(1) - 1
xx = ml * 100
Dim rbar As Rectangle
For j = 0 To chartdata.GetLength(0) - 1
yy = (Fond.Height - mb) - (((chartdata(j, i) - vmin) / ey) * ny + 1)
tx = (xx / 100)
xx0 = ex / 100
rbar = New Rectangle(tx, yy, xx0 / 2, 2)
Dim tmpcolor As Color
tmpcolor = Color.FromArgb(0, PenCourbe(i).Color.R, PenCourbe(i).Color.G, PenCourbe(i).Color.B)
Dim tmpbrush = New LinearGradientBrush(rbar, tmpcolor, PenCourbe(i).Color, LinearGradientMode.Horizontal)
tmpbrush.WrapMode = 3
If curseurVisible(i) = True Then g.FillRectangle(tmpbrush, tx, yy, xx0, 2)
rbar = New Rectangle(tx, yy, xx0 / 4, 2)
tmpbrush = New LinearGradientBrush(rbar, PenCourbe(i).Color, tmpcolor, LinearGradientMode.Horizontal)
tmpbrush.WrapMode = 3
xx1 = xx0 / 2
tx1 = tx + (xx0 / 4)
yy1 = yy - 1
tx = tx + (xx0 / 2)
If curseurVisible(i) = True Then g.FillRectangle(tmpbrush, tx1, yy1, xx1, 4)
If curseurVisible(i) = True And pvisible = True Then g.FillPie(PenCourbe(i).Brush, tx - 6, yy1 - 5, 12, 12, 0, 360)
xx = xx + ex
Next
Next
Catch ex As Exception
End Try
End Sub
Private Sub dessinemoyenne(ByVal g As Graphics)
Dim i As Integer, j As Integer, yy As Integer, v As Integer, m As Double
Try
'dessine moyenne
For i = 1 To chartdata.GetLength(1) - 1
v = 0
For j = 0 To chartdata.GetLength(0) - 1
v = v + (chartdata(j, i) - vmin)
Next
m = (v / chartdata.GetLength(0)) * 100
moy(i) = m / 100
yy = Fond.Height - ((m / ey) * ny / 100) - mb
Dim tp As New Pen(Color.AliceBlue, 2)
tp.Color = PenCourbe(i).Color
tp.DashStyle = DashStyle.Dash
If ValeurMoyenne(i) = True Then g.DrawLine(tp, ml, yy, Fond.Width - (ml), yy)
tp.Dispose()
Next
Catch ex As Exception
End Try
End Sub
Private Sub graph_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim i As Integer
Try
Fond.Top = 0
Fond.Left = 0
Fond.Height = Me.Height
Fond.Width = Me.Width
For i = 0 To 2
PenCourbe(i) = New Pen(Color.Red, 3)
Next
Me.SetStyle(Windows.Forms.ControlStyles.ResizeRedraw, True)
Catch ex As Exception
End Try
End Sub
Private Sub Panel1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Fond.MouseDown
Try
If zoom = False Then Exit Sub
If e.Button = Windows.Forms.MouseButtons.Left Then
If Fond.Width > 4000 Then Exit Sub
Fond.Dock = Windows.Forms.DockStyle.None
Fond.Left = -(Math.Abs(Fond.Left) + e.X)
Fond.Width = Fond.Width * 2
If Fond.Width <= Me.Width Then Fond.Left = 0
End If
If e.Button = Windows.Forms.MouseButtons.Right Then
If Fond.Width = Me.Width Then Exit Sub
Fond.Dock = Windows.Forms.DockStyle.None
Fond.Left = -(Math.Abs(Fond.Left) - e.X / 2)
Fond.Width = Fond.Width / 2
If Fond.Width <= Me.Width Then
Fond.Left = 0
Fond.Width = Me.Width
End If
End If
Catch ex As Exception
End Try
End Sub
Private Sub graph_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Try
Fond.Top = 0
Fond.Left = 0
Fond.Height = Me.Height
Fond.Width = Me.Width
Me.Refresh()
Catch ex As Exception
End Try
End Sub
End Class
Posté le :
13/09/2007 14:58:01
Déposé sur
User control graphique vb 2005
Ton code ressemble étrangement à celui de nicolas99 posté en 2006, mis à part que t'as mis de l'ordre et remplacé le nom des variables par des noms plus cohérents...
J'ai trouvé comment afficher des données négatives:
Il faut utiliser la fonction MinVal() mais il faut la corriger car il y a une erreur:
"If OrdreCourbes.Count = 0 Then Return MaxVal()" c'est Return MinVal et pas MaxVal..
Tu crée une variable privée dans le module (perso j'ai crée vmin)
dans la fonction DessineGrille, tu apelles Minval (par exemple après avoir appelé Maxval) et tu sauve la valeur min dans la variable vmin.
Tu rajoutes ensuite ce vmin dans chaque calcul de graphe, il doit y avoir 5 ou 6 zones à modifier (dans dessinecourbe, dessinemoyenne, dessinebar...)
La zone de code exacte à modifier est celle où tu définis les valeur de Y en fonction de TempValeurs
Par exemple "yCourbe = Fond.Height - MargeBasse - (TempValeurs(0) / EchelleAxeY * PasDeDessinY)"
à chaque fois tu rajoutes -vmin, ce qui donne dans l'exemple précédent:
"yCourbe = Fond.Height - MargeBasse - ((TempValeurs(0)-vmin) / EchelleAxeY * PasDeDessinY)"
C'est pareil à chaque fois que tu as y = quelque chose fonction de TempValeur.
Je ne donne pas le module modifié puisque j'ai en fait utilisé le code initial de nicolas99 et le variables ne correspondent pas...
Posté le :
13/09/2007 14:53:26
Déposé sur
User control graphique vb 2005
Est-il possible d'afficher des valeurs négatives??
Posté le :
12/09/2007 16:43:43
Déposé sur
User control graphique vb 2005
Bonjour,
Chez moi ça ne marche pas, j'ai un message d'erreur au chargement du projet: "Could not find type 'Graphique.UcGraph'".
une solution peut-être??
Merci
Posté le :
10/09/2007 17:14:00
Déposé sur
Ecriture & lecture en mode binaire dans un fichier
Je confirme que ce n'est pas du fichier bianire ça, c'est facile à voir en ouvrant le fichier créé avec un éditeur de texte, ça n'a rien de binaire!
Lorsque tu fais un "Put #N° file, 1 octet, Caractère" c'est le code ascii de 'Caractère' qui est enregistré dans le fichier, et pas le caractère lui même. Pour faire réellement de l'enregistrement en binaire, il faut ajouter une ligne:
CaracterBin = chr(Caractere)
Comme ça VB va considérer que ton caratère est un code ascii et va réellement enregistrer ce que tu lui demande.
Et arrêtez de vous insulter, un code aussi simple n'en vaut pas la peine.
Posté le :
24/08/2006 17:27:11
Déposé sur
Plein d'opérations simple pour gérer les process
Es-tu sûr que ton code fonctionne sous Windows NT ?
Parce que j'ai essayer d'affecter à "handle" le n° d'ouverture du fichier directement et ça ne parche pas quand même.
L'application à fermer est un exécutable Vb, la racine est sous C:, j'ai donc essayé comme titres "test.exe", "C:test.exe", "test" ......
Là je comprend pas...
Posté le :
28/08/2003 10:16:02
Déposé sur
Plein d'opérations simple pour gérer les process
Bonjour,
Je veux pouvoir arrêter un exécutable à partir d'un programme VB,
je pense que la fonction "Fermer_app" que tu propose est la solution à mon problème. Mais je n'arrive pas à la faire fonctionner car la variable "handle" utilisée dans la fonction vaut toujours "0".
La chaîne de chacartères "Titre" est bien le nom de l'exécutable à fermer avec son arborescence complète ?
Par avance, merci de ton aide.
Posté le :
27/08/2003 17:41:36
1
Nos sponsors
Derniers Blogs
[WP7] DYNAMICALLY CHANGE STARTUP PAGE
[WP7] DYNAMICALLY CHANGE STARTUP PAGE
par KooKiz
Let's say that you want to allow the user to customize the startup page of your application. You can easily change the startup page by editing the 'NavigationPage' attribute in the manifest file. But the manifest cannot be modified once the applicatio...
Cliquez pour lire la suite de l'article
par KooKiz
SESSION SILVERLIGHT 5 3D : SLIDES ET DEMOS
SESSION SILVERLIGHT 5 3D : SLIDES ET DEMOS
par Groc
Durant les techdays, j'ai eu le plaisir d'animer une session sur Silverlight 5 et la 3D avec Simon Ferquel. Comme promis, voici nos slides et mes démos (celles avec le viper BSG) ici et là. Pour mémoire, les démos utilisent toutes le viper BSG...
Cliquez pour lire la suite de l'article
par Groc
[TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES
[TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES
par gpommier
Suite à la session que j'ai présenté sur WebMatrix 2, vous pouvez trouver les slides ici, ainsi que les démos en packages nuget : démos1 et démos2 J'en profite pour remercier chaleureusement tous ceux qui sont venus très nombreux à cette sess...
Cliquez pour lire la suite de l'article
par gpommier
[SHAREPOINT] LES SESSIONS TECHDAYS 2012.
[SHAREPOINT] LES SESSIONS TECHDAYS 2012.
par Patrick Guimonet
Voici donc pour ceux qui n'ont pas pu venir, ou ceux qui n'ont pas pu toutes les suivre la liste des sessions SharePoint aux TechDays 2012, que je mettrais à jour dès que les liens des vidéo seront disponibles. Ou ici : http...
Cliquez pour lire la suite de l'article
par Patrick Guimonet
TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3
TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3
par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article
par ROMELARD Fabrice
La suite
RSS
Côté IT
Utiliser Office 365 pour un projet d?équipe - PART 2
Utiliser Office 365 pour un projet d?équipe - PART 1
SharePoint 2007 : Installation du Service Pack 3 de MOSS
SharePoint 2007 : Installation du Service Pack 3 de WSS V3
Installation de SQL Server DENALI CTP3
Mise à jour de Windows 2003 R2 vers Windows 2008 R2
Upgrade de SQL Server 2005 vers SQL Server 2008 R2
La suite
RSS
Offres d'emploi
Recherche Recherche développeur web ASP et ASP.Net
Recherche Analyste Programmeur Adélia
Recherche Développeur eZ Publish confirmé
Recherche AP (H/F) ACCESS EXCEL VBA
Recherche SUPPORT INFORMATIQUE / DEVELOPPEUR
Recherche Developpeur web
Recherche développeur Web
Déposer une offre
La suite
RSS
Formations Video
Coffret : Ateliers sur la mode
Atelier sur la mode : Motifs et matières
Atelier sur la mode : La planche tendance
Atelier sur la mode : De retour de pige et repérage
Corel Painter 12 : Les fondamentaux
Coffret : Microsoft Office 2010 de A à Z
De Microsoft Office 2003 à 2007 et 2010
La suite
RSS
Appels d'offres
Passerelle Pericles sur site Joomla 17
Budget :
499€
Infogerance Serveur Debian Linux
Budget :
2 400€
Developpeur applications iphone - ipad - android
Budget :
800€
La suite
RSS
Logiciels
Tribler (2012)
TRIBLER (2012)
Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des...
Cliquez pour télécharger Tribler
OneSwarm (2012)
ONESWARM (2012)
Le peer-to-peer qui protège votre vie privée, c'est OneSwarm. Ce logiciel de peer-to-peer crypté...
Cliquez pour télécharger OneSwarm
PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)
PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)
PONAMEDIA TV DEVIENS HELLLOOO FLASH LA TV SUR VOTRE ORDINATEUR. Toute une plateforme Multi...
Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO
Academy System (17.2.1.0)
ACADEMY SYSTEM (17.2.1.0)
Logiciel de gestion des établissements. - élèves/étudiants (inscription, dossier, absence...) -...
Cliquez pour télécharger Academy System
Easy-Planning (1.0.0.1)
EASY-PLANNING (1.0.0.1)
Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ...
Cliquez pour télécharger Easy-Planning
+ de logiciels à télécharger
Vidéos drôles
Halloween Party
Terry Tate Office Linebacker Superbowl 2003
Jeu vidéo instructif
C'est un véritable vol !
Banana Song
Comment attraper la grippe A
Parodie Pub Window 7
La suite
RSS
Sondage...
Votre navigateur n'utilise pas le javascript, pour
voter aux sondages de ce site, cliquez ici
Statistiques
1 873 905
membres
171
nouveaux aujourd'hui
16 151
membres club
Comparez les prix
Archos Tablette PC ARNOVA ARNOVA 10 4GB
Entre 200€ et 210€
Visiter le guide achat
CalendriCode
Février
2012
L
M
M
J
V
S
D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Consulter la suite du CalendriCode
Photothèque
Visiter la photothèque
CS Tool Box