cs_Sipat
Messages postés71Date d'inscriptionmardi 26 octobre 2004StatutMembreDernière intervention15 avril 2007 14 févr. 2007 à 10:06
Bonjour,
Il faut que je supprime le TabControl que j'ai m'y sur la Form1 ?
Parceque après dans la liste des propriétés il y à que Form1 !
J'ai regardé dans la liste des objets(boites à outil) il y à pas TabControlPerso.
Quand je laisse le TabControl et que je regarde en haut à gauche il y a :
Nom de la class j'en trouve deux :
TabControlPerso(WindowsAapplication3.Form1)
(TabControlPersoEvents)
Apparement c'est le deuxieme qu'il faut prendre je selectionne click
Donc sur ma Form1 j'ai un TabControl1 et dans la liste des propriété j'ai que deux ligne Form1 et TabControl1 après je fais quoi ?
Private
Sub TabControlPerso_Click(
ByVal sender
As
Object,
ByVal e
As System.EventArgs)
Handles
MyBase.Click
cs_Sipat
Messages postés71Date d'inscriptionmardi 26 octobre 2004StatutMembreDernière intervention15 avril 2007 14 févr. 2007 à 19:06
Bonsoir, désolé de te prendre la tête voilà tout le code.
Public
Class Form1
Inherits System.Windows.Forms.Form
#
Region " Code généré par le Concepteur Windows Form "
Public
Sub
New()
MyBase.New()
'Cet appel est requis par le Concepteur Windows Form.
InitializeComponent()
'Ajoutez une initialisation quelconque après l'appel InitializeComponent()
End
Sub
'La méthode substituée Dispose du formulaire pour nettoyer la liste des composants.
Protected
Overloads
Overrides
Sub Dispose(
ByVal disposing
As
Boolean)
If disposing
Then
If
Not (components
Is
Nothing)
Then
components.Dispose()
End
If
End
If
MyBase.Dispose(disposing)
End
Sub
'Requis par le Concepteur Windows Form
Private components
As System.ComponentModel.IContainer
'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée en utilisant le Concepteur Windows Form.
'Ne la modifiez pas en utilisant l'éditeur de code.
Friend
WithEvents TabControl1
As System.Windows.Forms.TabControl
Friend
WithEvents TabPage1
As System.Windows.Forms.TabPage
Friend
WithEvents TabPage2
As System.Windows.Forms.TabPage
<System.Diagnostics.DebuggerStepThrough()>
Private
Sub InitializeComponent()
Me.TabControl1 =
New System.Windows.Forms.TabControl
Me.TabControl1.Location =
New System.Drawing.Point(48, 56)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size =
New System.Drawing.Size(208, 168)
Me.TabControl1.TabIndex = 0
'TabPage1
'
Me.TabPage1.Location =
New System.Drawing.Point(4, 22)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Size =
New System.Drawing.Size(200, 142)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "TabPage1"
'TabPage2
'
Me.TabPage2.Location =
New System.Drawing.Point(4, 22)
Me.TabPage2.Name = "TabPage2"
Me.TabPage2.Size =
New System.Drawing.Size(200, 142)
Me.TabPage2.TabIndex = 1
Me.TabPage2.Text = "TabPage2"
'
'Form1
'
Me.AutoScaleBaseSize =
New System.Drawing.Size(5, 13)
Me.ClientSize =
New System.Drawing.Size(292, 266)
Me.Controls.Add(
Me.TabControl1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.TabControl1.ResumeLayout(
False)
Me.ResumeLayout(
False)
End
Sub
#
End
Region
Private
Sub Form1_Load(
ByVal sender
As System.Object,
ByVal e
As System.EventArgs)
Handles
MyBase.Load
End
Sub
Private
Sub TabControl1_SelectedIndexChanged(
ByVal sender
As System.Object,
ByVal e
As System.EventArgs)
Handles TabControl1.SelectedIndexChanged
End
Sub
Protected
Overrides
Sub OnDrawItem(
ByVal e
As System.Windows.Forms.DrawItemEventArgs)
Dim TxtAttr
As
New System.Drawing.StringFormat
TxtAttr.LineAlignment = System.Drawing.StringAlignment.Center
TxtAttr.Alignment = System.Drawing.StringAlignment.Center
Dim FontStyle
As System.Drawing.FontStyle = System.Drawing.FontStyle.Regular
If
CBool(e.State
And System.Windows.Forms.DrawItemState.Selected)
Then FontStyle = System.Drawing.FontStyle.Bold
e.Graphics.DrawString(
MyBase.TabPages(e.Index).Text,
New System.Drawing.Font(e.Font, FontStyle), System.Drawing.Brushes.Black,
New System.Drawing.RectangleF(
CSng(e.Bounds.Left),
CSng(e.Bounds.Top),
CSng(e.Bounds.Width),
CSng(e.Bounds.Height)), TxtAttr)
MyBase.OnDrawItem(e)
End
Sub
Private
Sub TabControlPerso_Click(
ByVal sender
As
Object,
ByVal e
As System.EventArgs)
Handles
MyBase.Click