Cours gratuits » Cours informatique » Cours programmation » Cours visual basic » Support de cours en Visual Basic

Support de cours en Visual Basic

Problème à signaler:

Télécharger



★★★★★★★★★★3.5 étoiles sur 5 basé sur 1 votes.
Votez ce document:

 

!"# $ % $

&%                                                 %                        %’ (

)

*

+ % "                      ,-.            %

1 &20+345% 6

            /                      % & /                           %

&0

%

%$ %

/1 &

) #77

8

9

               %                 : % &

;% $                              ;%                    <             /

 

+% 9

%                    =                    $

& % %

   

            ;% .                                 ;% .;%

             >$                          ?@% /% )

   
 

3&%                           %                      .%                                                                                    ;% %                     #

-    0 %  =              )               ;%&%      %3           <

-    0%= %            % %         $;%         A

                                    $%                                  % %                                                         $ = &%.                                               %

          $%                            + % " . %                          %                       B /                                     / &

                     &                          ;%                                         % %                   A

-    0 %  ;%            %             .1             #

                <         %                                                                     .

                          < = )/                    1                                             %                                                                             %

                                                   1%                                              $                                       %.

                             < = )/ 1                                                                                  %                   %            @            %

2      & %       . )             ;%            #

 

3      /             $              & 8 %      $ ( <        -

                                                                             /                                                                 % % .

                                             C                    $D$$ %                                    % 0

                                                                                                                 $                         &                                                       + %

"

 

                                                             /             %                       ;%                                  22.                                                       %

                                   ;%             3

                                              &%                                    ;%                                         %&%8;%&

%

                                                  %                                                 8 %                                     &%

                 &                                  .                  $                                        .                             ;%                     $

                                                             ;%             %%                    /%                 E %                %

!"

                                                                                + % "                   & 8 %                 %                         <$                    B

F

.                                  .! H 45 H                           %6. !                      +@                  ;%

% ) 8                                        )

#

$ %

%

             D                                               %                                      & 8 %               %                             <$

 

.

                              J 1 + % "                             %1 % %

;% % %

           % 4%                      %

 

+"6

             D                                  %                 B /

%                      %

<$

.

                                                ;% %8;%                       $

%

                          %              %

$

 

D % B / % % ) C $

&%

%

 

.

#

   

             !                                                 %                  %

& 8 %                 ,</

   

                   !%                                          %                               B / % <

            <$                                 . %.K!0.

B F ! 4 % H 5 H63 1. % / %8 1 % L+

# $

%

 

&’( )

 

               

K                                      / & /’                      %               %                                  %                                                  & 8 %

&%                                             . %                                 %                                %8.1                  #

/’

& /’ K

& /’                       /

& /’ 28

                   /’                           %$ %                         4               %                /’ 6

!%                                        %                                 .                       ;% %                                                                                   % %

&%                                            $$                   /’                                                   %                                       ;%                           %

              %                                     22                             D                 %                                                                        $) D

%/4&                     &        %                    % $$                                %                           %/            %                                   6

                  %             ’                             22.                    ’% <@%                              %                   % )

% ’PrjCtl.                                         % %                      UserControl1   MonControle

 

;%               ’                            .                                                %                    = %                        M%                                    0

          %            = %              ;%M1 M                % % ’                       ;%

3                   $ =            %                    MonControle.                                              %            #

Dim m_MaProp As String

Public Property Get MaProp() As String

      MaProp = m_MaProp

End Property

Public Property Let MaProp(vValeur As String)     m_MaProp = vValeur End Property

2 )                                                                            $% %’                           MaFeuilleN                                 $% ;%&

%                       %

5                                                        /O 1 % .                               % %                                                   1

                 ;% % $                                $ =             %                   .                          &            %                                                %

% $%MaFeuille

                               ;% %                                          %                   .           MonControle1

                                                          +@                                                                                        # MaProp$%

. ;%&% ;% & % < ( % -48 6.

% /’ 8 $% %4 .+ % " 6

5              $                         $ =                                                                    $% .

%                               $ =                                                               % .

/                                                        $% # & %                                                 %

          <                   %                                                                       ;% ;%

                      &                                  /

5                                                                           %

$ =

%

%

#

 

Event Click()

Private Sub UserControl_Click()

    RaiseEvent Click

End Sub

         

                               $ =                                            ;%

$% #

$ =

 

%

.

’%

Private Sub MonControle1_Click()

    MsgBox "MonControle a été cliqué !" End Sub

       

                                                          28 %                                                          ’.                              $ ;%                         $%

                                                       MaFeuille      $%                                                  ;%                % 9                P

                                                                                                           4%                        $% MaFeuille6. % /O

                                                                     %                   O.               ;%                                  $% <

5                                     ’                                              $ =                                               %                         %

’%                                                % /%              %                    #

Event ClicBouton()

Private Sub MonBouton_Click()

RaiseEvent ClicBouton End Sub

              ;%                        %                                  $% MaFeuille#

Private Sub MonControle1_ClicBouton()

    MsgBox "MonBouton a été cliqué !" End Sub

28 %                                ’.                 ;%                % /                   % 9                %                               ;% % /%                       3%

                           % %                               %.                Q                          %8                                                                 Click%8

$                                                                                 DC.% %& /’UserControl.                                       & %%

/% .;%                         %                                        %$

’% % ;% %                                                                                         ;%                              %                             &

UserControl_Paint()#

Private Sub UserControl_Paint()

    If Ambient.UserMode Then

Lbl1.Caption = "Le container est en mode exécution !"

    Else

Lbl1.Caption = "Le container est en mode conception!"

    End If End Sub

                                         %                         @                      $%                                                                 

 28 %                                                                                           ’                              @ 1 % % $%

               %           /                                                                    $&%

%                               & 8 %               0%                  %                    & /’ Ambient.;%                                         $

1                          &                                      %                   %

+@                                                         ; @                   & /’ ;%               %                   %                 4;% ;% <%

6

H

# !&’( Control

 

            %                       %                       ;% &                                                             ;%& % % %                                            & /’

                          %< = .                                             . & /’ MonControle        /’                   %8/% #                $

                          )%/;% .                                                                                                       /1 %8;% %

                  .                  $                                                  %

2 %                                 )                                                                              ;% &.%                                                                 A%8

                                                /’ UserControl. Extender. Ambient             %

                    %$;% &                   ’% 1

# !&’( UserControl

 

3%                                                      %%%.& /’UserControl                  % %< /’

                                           D A%8)                                              & /’UserControl       %                                     @ 8

UserControl.method() & /’UserControl %

/’Control %;%                               %                                                                   %<

3% % &% + % " . & /’ Control ;% ;% % %< /’ & /’ UserControl;% + % "

                                         & /’UserControl %% %+ % "                                     :                 B              F :

%                                               %                                   & /’ UserControl.;%

%

& /’UserControl              /                                                                                        $ = %.

                         7                                                                    %                        4$ %6.                %           ;%

                                    &              $ %                  %          %

Control%

              %          8                          1 & /’

& /’UserControl          & /’                         $% %

% /                                   . @                 %

8                                     #                              ;% &

Caption&% $%

                                                               ;% % $                           %            %

Caption%

                          = $% .                              %                                                   )

Caption$%

$%                                $% #                            /               $

)                                /                     =

                  $                   /                            %

)                                            )                 %

)                  %             $                   /                       C                              %’%

/ &                              1                           /

/Caption.                                       $8            8                          #Form.Caption

 

! 9;%

 

                                                                    %                 ;%

%

 

% . 1

%

5 % 9 8 %8 % %

 

;%

UserControl_Click. %                         9 $ %             %                                                             /’ Control&

%< =

,

## !&’( Ambient

 

               /’                %                     % /                              $                          %                    %

/’                                                                         ;%                                             /               $$                                             %

                                         ;%                                            %           %                            8                 . %                       %

                          UserMode. ;%                                                                                          %

%& 8 %(Ambient.UserMode) K %8

BackColor. ;%                             & /                         % %             $            %                    %                            % = %

                                 P                                            /%%                                                           % %                       $ 4$

& ’%                          8                    6 & /’ UserControl $%                 &                                    AmbientChanged. ;%

                                &=           $                     ;%                                           BackColor$

                            %           %                 $           %                                                         /                                                   $

                                              4@                                                                                 %              /                       & 8                   %

& /’                         + % "                                ;% %8                            %                                       +"6 % $

%%.& /’Ambient                                              %%;%

          %                                                     %                    $%                                                                   $<<                         ;%&%

                   % &                        /           &                              %                                     /                                   ;% UserMode>S

             5              &                                              .                                                       %<

                   %                                                                  %             >0                       %                                                     %

% $Q                                           %                               $$

& 8 %                           %8< &                       /                 & 8                                            UserMode. %;%                          & /’

Ambient    %                            $%                    %true

#* !&’( Extender

 

0       8             %8           ;% &        / %          1

$                    %8<   8              . );%        + % "       A % Name#           <              % 3& %   ;%            /

. %Right

          ;%&%                             % %

.

% ’% %                                ;%

                          1 &            $

$ ;%

                     % %             @

.Extender

%

                 /              $                    $$

$%

%

$%

. & % % %                                                                 3

%.                            /

&

Extender 4 $ .                                 %

$ 6C

            / &                          %8

Extender$%                                                 %          %                    & /’ Extender

                         &                             /                          O                                        &%                      % 1 &                             . & A

1       <             $              %’%

R

#+ ! ’(                                                    , &

 

3&%                                        A .                                    /’                       % $              1                       % 0 $

8 = A ;%&% % % $% . % % % & %% $% D @ A = A .

                                                                                 A                      ;% C                                     # $%                  %                   ;%

                            % ;% %                                                                              & %                                                                     A %8.

)                                                                                                                      %$. 1                                      ;% %

8                         8

# - "                                            ’( &

 

$% %

%

A /’ %

            ;%           %

 

%

%)

. % & /’

UserControl

%

 

%$.                        %

;%                        /’

 

                                            -                                     ’(

I

* 0 " 23         4

 

1’( UserControl

                  $                                                                                                M% /’ UserControl         %                  #

•    +%   9%           &%          %/ < ;%   % /O 1 %                %

                           %                  % $%                      % ;% %                                       %                                                   /

                                                                                       %$4 @                  6                                & /’ UserControl

                          .                                                 %$@                    %

•    MInitialize    %1 );% $ ;%M%

                                                             %                        M            %’%                                                                                      M%

•    MInitProperties      % %         A

                 M%                                                   .;%M%                                            %                                                                %%

                      $% 3                                                        . % $                   9                  %                                                               %

•    MReadProperties      %             %8A

                                        %                   .                                ) %                         %                                       %                    3

                                                     . %                   % 9                       %                                              M                     %

                                                                                   %$) $                                               1                     $% %;%

•    MResize  % 1 );% $ ;%M%    M%

                                               . 1 );% $ ;%M                                                                                                                         .

                                                    % M% $% .                                                  . %                                  M8 %              5

                     /’UserControl                              %$. %                                     9

                                %                        1                                               . ;% $ M

•    MPaint   %1 );% $ ;%           %             %

                                                                             %< =                            %                                                  1 %.=

                                                                                                                                             Show 4            8                            . %

                  $%                     ) M                         6 %                                                                     . M                         Paint

                                   %;%%                                         9 M                                                                                         5M M@ %%

%$. M/’UserControl%< =

•    +%   9& 8 %   4H6+ % "                $              $%

•    MWriteProperties     %;%M%( <              -

                                                                        % . A                  ;%M%                 M%                        %

                    )                3                                                   . % %                            9 %                             %

                       $                    %                                 % % M                           %                                          %

%$) $

•    MTerminate     %;%         %             M=

                            % M/’UserControl                         %$                        %

G

+567"%

+

 

& % % %                                     %                                                              &          @                                % <

         %               /% %B                  F &                    ) $                           Mail Now !.%                           &D% T

&                                                           ;%                    & $                        1                   %                          % .                              %

                                         %5C . %                                                     &                      %. % %                                    .

%’%                                                                             A                                                              A%8                                         5C .

                        %                                 %                                                     C !F 8%                      %                                            %$

$%                       C              $                     +". B               T.                                                                       % ’;% )

&                                                  @ @4                                                          /                             J) 6. $                       %          @

%

+                                               &                                          ""                           )

 

;% %

%

!%

;%

 

&%

$

DC.

) %

 

5C

   
 

                             B                  T: ;% &                       &           $                       / 1 & 8 %                 :                        &

$                           %8                                         %                      4                                                            6               K3 4

 !                                             60 %$$.                                1                O           %                                                        8 .

$                                                        &          ;%                         )                %                           %           %                            8

            %                  )                                          %                )                                                            &%          % & %

&                            ;%          %                                                    %                            8 . % %

         .                    %

                   /                                            %                     8                    %                       %                   .

%8 %8                                    % & )                                                          %                 %                                                            . %

                           O                                              &                              % % 4%                                                 0.

" # 6.                                      ;%                       4                       "                             6 % ;%                                               (1 & % -.

%                  ;%                      )                                 !%                  %           %                                 &                                          %.

                                                                1             @

K $ 8 . ) % % % @ 4 ) $ 6

4 )% .;% % &                          6

&                                         ’$( )$ (                                                            *

                   %                                              %                                        A D50. & <1<                 ;%&                              )

                                       & $                                                    $%8                                                           )                                  %)

                             ;%            1                  & %                                                                     %&%

               %A               % %                                                               70               %                                                 %                      #

-           % 1

-           4+               6.             $              $)

-           5!C 4$        , - ( !        6.             &

%8

-           5C 4$ (       6. %         %             ;%

&            %                                       A ;% % %

$% %                                                       % )                    & )                         <           %                         70

 

0 8 %                              % % &                                               &

&%                         % 4CS.2 . %                                C%)

%K 8 %                                                  %%6& )

%%                                                                         $$ %%

                                   $                                       4C 6.                %

                  % % K 8                       5                             !%

&                                       %                                                               C .

                                                     & %(                       70.

A                                    -.                               BU 5                              4

A % %’

//                                     ) 6. % % 8

0@ %                                     /                                             ;%

                  %                  @ %                   %#

&%              %9           4                                   .                     %

6!%

% 84$ $6.$$ %%%

K 8. ;%                                              %

                                                %                                      ;%

              A                                           %8                                   & % %.

            ;%&                                     %%

// nous invoquons l’agent utilisateur mail –v // ceci est affiché par l’agent

To :

// on nous demande ensuite le sujet

Subject : test

// l’agent ajoute une ligne blanche entre les entêtes et le corps 

// le corps de notre message, termine par un point signifiant la fin du msg a dimanche pour notre partie de golf.

.

// affichage de l’agent utilisateur

 

     

Sending letter . . . . . .

// l’affichage qui suit (et jusqu’au bout) est la sortie du MTA (Sendmail dans notre cas)

Connecting to mailhost via ether . . .

Trying 140.253.1.34 . . . connected.

// le client effectue une ouverture active du port TCP 25. Quand c’est fait, le client attend un message de bienvenue (code de réponse 220) du serveur. Cette réponse du serveur doit commencer avec le nom entièrement qualifié et conforme du domaine de la machine serveur  

220 Sendmail 4.1/SAG-Noao.G89 ready at Mon, 20 Oct 01 15:34:22 MST 

// le client s’identifie avec la commande HELO, dont l’argument est le nom totalement qualifié du nom de domaine de la machine cliente 

>>> HELO .

250 Hello ., pleased to meet you 

// identification de l’expediteur du mail

>>> MAIL From :<>

250 <> . . . Sender OK

// identification du destinataire

>>> RCPT TO : <> . . . Recipient OK

// envoi des données

>>> DATA

354 Enter mail, end with « . » on a line by itself  >>>.

250 Mail accepted

>>> QUIT

221 delivering mail

  . . . Sent sent.

 

                                . % H                                                       8 %            #               &                          . S2D. C 0

UDC.U

D.3 . VK0

U

, .

%                    C                  $ %

%

%%           % #& % %%           Mail Now ! %8 A$               4% %       / 6’%;%&1             ;%&% % %          %             &20+34 @6

WK

%8A                             .                  .            %=               %                 %                            <                A

8

                   % / ;%                                             4                       &        %               %                                         %

5C

                                       %             1 &%               %6.                                         $

&

                   %8A                                            %                                                               4            %

A

                   %                          %8                                               $%                              8                    ;% %

3U 6

+# %

 

C                               ;% %                            %

&%

$

5C . %

!                                .                      MailNow.

            &          @                                1

 

&%

$

                     $ 1 & 8=                                 %

A                             %                          /

 

&

%

                 %5C . &                                             &

%                           %                  %

     

                     Q                                        $ &                   $

);% %

A

   

$ =

% % ’. %

   

& /’

UserControl1          =                              /’ ;% % $% %

 

’%Winsock 4;%

% %

/ %

%

W6

&                         P % UserControl

                                            %                        % /% CmdNew.                                            A ;%&%                        % /%

$$                       )              (                         %                                         -.( %’ -. (                         -                  .% %                     %

                                     @ % %                            & %                 1 $$               %< =                       )

' bouton nouveau mail

Private Sub CmdNew_Click()

TxtRecepteur = ""

TxtSujet = ""

    TxtMail = ""

End Sub

                    % @              %                      %                                               /                                            %

               %5C                                  #

Private Enum SMTP_State

MAIL_CONNECT

MAIL_HELO

MAIL_FROM

MAIL_RCPTTO

MAIL_DATA

MAIL_DOT

MAIL_QUIT

End Enum

Private m_State As SMTP_State

 

%

 

&

Winsock1_DataArrival.;%

% $

8

+@

 

                                  8             & $$ % #

' bouton envoyer mail

Private Sub CmdMailnow_Click()     Winsock1.Connect Trim$(txtSMTP), 25     m_State = MAIL_CONNECT

End Sub

K                  %                           /% Mail Now !

8 %

8

%

% 5C 4txtSMTP6 %

&DataArrival

 

4

 

      1             )$$ 6

8                       %

%

if ;%

:

% :

            A               ;%

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) 

    Dim strServerResponse   As String

    Dim strResponseCode     As String

    Dim strDataToSend       As String

'Sortir les données du tampon de la socket

Winsock1.GetData strServerResponse

Debug.Print strServerResponse

'Reception du code de reponse du serveur     strResponseCode = Left(strServerResponse, 3)

    '

'traitements a effectuer en fonction du code

    'de reponse envoye par le serveur     If strResponseCode = "250" Or _        strResponseCode = "220" Or _        strResponseCode = "354" Then        

Select Case m_State

‘…

‘… ICI SELON LE CODE A 3 CHIFFRES RECU !

‘…

End Select

    Else

'En cas de reponse du serveur ne figurant

'pas dans la liste requise, la connexion         'est fermee, et l'utilisateur recoit le

'code d'erreur

Winsock1.Close

If Not m_State = MAIL_QUIT Then

            MsgBox "SMTP Error: " & strServerResponse, _                     vbInformation, "SMTP Error"

Else

' affichage d'envoi             lblStatus.Caption = "Votre mail est envoyé !"              lblStatus.Refresh

End If

    End If

End Sub

. @                                                                                                       8 4 %                                      % ;%

MAIL_CONNECT.                                                                                                      #                     8           %                      %6#

Select Case m_State

Case MAIL_CONNECT

lblStatus.Caption = "Connexion " ' affichage de l'etat                 lblStatus.Refresh

                'changement de l'etat de la session                 m_State = MAIL_HELO

  'suppression des espaces blancs                 strDataToSend = Trim$(TxtEmetteur)                 'extraction de l'adresse email

strDataToSend = Left$(strDataToSend, _

InStr(1, strDataToSend, "@") - 1)

'envoi de la commande HELO au serveur

Winsock1.SendData "HELO " & strDataToSend & vbCrLf

Debug.Print "HELO " & strDataToSend

' affichage de connexion effectuee                 lblStatus.Caption = "Connecté !"                  lblStatus.Refresh

               $$)                                   3/%                               %                    %                                         $ =               & 8 %

                                $$ %                                                        U                       ;%& &                                 /                              / %

                       ’                                     ;%& %                                       Winsock.         ;%&%               T                    % =

(                       -               8 %

’%                                                   %/% CmdSite %<                                                            & %% $ = 0

28                 402                                                                      % %                       6                     $            &% &%                       4

& %                            %             & % %6#

 

5 $                     %8          8                    %           %

& %                                     ;% $                                                        1 & % %W

 H

' bouton permettant de se déplacer sur le site web de l'auteur

Private Sub CmdSite_Click()

 Hyperlink.NavigateTo Target:="; End Sub

K $                                              .                                                                                =’%% ’                                                        22

4                      PrjSMTP6 $                                              .                                    %                                        %<

% $%PrjSMTP

W

! %

% %

 

                                                                      % $$ %                                                                                  1 $ = Propriétés% $$)

                                                                                            +%               % 9                %             %%                                        % %

                                                              %                                         % .%%                       %                        %                     %

                                                    8          %                  $ = Propriétés &%                          $           @         &                  &%

/O                             %

     

+ % "                     $%

   

#StandardFont. StandardColor.

StandardPicture 5 %

9

 

@ Font.OLE_COLOR%Picture.

$ =Propriétés                                + % "

 

%

;%                                                        1

   

$% %

% 8

                           < ;%                                     %8

 

< $%

+ % "                                 );%

% /’PropertyPage                                                     )            %

% %                              %          %               % &                                   ;%                ) 8                                               % % & $$ %

                          .                                 1 % %                  %                  $ = ;%                                                           C            %

             %                             % $                                      $                                              %                      ;%

= $                                      $ =                                              3                                      .              %          @        &                %

               % %%                                            &%            %                                                   C               %                       ;%

% /%

 

K                                                             %                              =           %           .                                   % $% 4/ ;%

                                             / 1                              &% $% . %                                 ;%               $

A6&                                                                                                                         %                         B             T.

$% %

 R

 

                                                      &%                              $ = . & /’ PropertyPage & $$)                            &                    0

& $$)                                   %                 /%              OK. Annuler.              Appliquer 4 ;%&               8            .               ;%

&                                                                8                 6 %8<                      $%             %               ;%                                        /O

%Pages de propriétés.                                            $                               & %% /’                                 % PropertyPage

          /O                         % Pages de propriétés %                                                   8%&

Caption& /’PropertyPage

!%

   

$

   

.

% .

 

1%

. % %

 

;%

$%

+ % "

 

                 /                        "                    %                     % %

 

!%                              ’1                                     % ;%             $

&%

$$                                   % &% $%                          8               .;%

/O                                % Pages de propriétés

            %                             &%                                                 . &

Initialize;%

Q & /’ PropertyPage : 8

                          %           $%                            % $ .

1% $% . & /’ PropertyPage

Q                    &                         Load

&                                                               % & /’ PropertyPage&SelectionChanged

                                                                   ;%                                8 % & /’ PropertyPage#

                 3          &                             SelectionChanged. /                               %                                    1

                   3$                                                          Changed& /’PropertyPage );% $ ;% &%                                      %

                             %                %

                 3                         & ApplyChanges.                                        %                                    4%                                    6

                                           46                   %

 I

+@                                              %                A              %

/0                            $                        1 !

                                                         %;%                                                                                         $$)                    ;%                 %

)                                             %                                                                                           ,

+%                         9 %’%

)% A$                                                                                                           % 9.% )

                       % )                            $                                 &

         !                                   0                        SelectionChanged

           )                    %                                          ;% % % 91$                                 &                            SelectionChanged

                      $                         %                                                   ;% $$)                             %                                                      %

                                          9             8                                     Général %%                                               +                         #

 

5%

9;%

Age

%

+

%

&

%

Enum%/;%

%

#

             

Public Enum DinoAge     vvPetit     vvJeune     vvAdult

End Enum

 

,                   8          .        A

%

   

%                        /O

 

% Pages

de propriétés. %                           % %

&

;%& %

E )

 

%8

 

                                 2 ;%             %

 

%

 

%) Ctrl $

.

% ’%

%                                      1

%                        SelectionChanged

   

) %

     

 G

&SelectionChanged                                  %                              / 1                #

Private Sub PropertyPage_SelectionChanged()

      ‘ place la valeur de la propriété DinoName pour le premier     ‘ contrôle sélectionné dans la zone de texte txtDinoName ‘ pour affichage et édition.

TxtDinoName = SelectedControls(0).DinoName

‘ utilise la valeur de la propriété Age du premier contrôle

‘ sélectionné pour sélectionner l’option appropriée dans le

‘ cadre d’options Age.

optAge(SelectedControls(0).Age).Value = True

‘ Le code ci-dessus résulte du fait que les éléments de l’instruction

‘ Enum DinoAge ont les valeurs 0, 1, et 2.

End Sub

/                            SelectedControls

 

          SelectedControls          %                                   ;%                 %

                      % % ;%                                                           %                                       %                                    % %

                                                  5                                                                                                                          %&%

                                          .                                                                %                                     % %@

R

 

%

. 9

/ ;%                                           %                                                                     % =

 

;% $

                        <          %                &                           SelectionChanged

 

1                                     %

);%                                   %                                                                                   1

&

%

%

3

&%% ;%

                           .%                                        %                                                    %

 

%

                )                  P&%                   % %

2 0

 

% %

%

                                                               %                      / &                              . %

% 9%                          %                                %

          $                              O                                            &

;%

                               4                       ;%                                                /

          %                    / 6.                       $

             O                                                                  ;%                        %

$

%

             %                  %                                                   %                             % 9 /

 

Private Sub PropertyPage_SelectionChanged()

      TxtDinoName = SelectedControls(0).DinoName

      ‘ crée une liste déroulante contenant les valeurs et les noms des ‘ éléments Enum pour la propriété Age, et sélectionne celle 

‘ qui correspond à la valeur courante de la propriété Age.

cboAge.AddItem vvPetit & «  - vvPetit » cboAge.AddItem vvJeune & «  - vvJeune » cboAge.AddItem vvAdulte & «  - vvAdulte »

‘ l’index de chaque élément Enum dans la liste déroulante est

‘ identique à la valeur de l’élément End Sub

 

R +% & 91 % ;%%$;%                                                                                                                         & %;%                                    4

8TextBox6                                                         /O                             % Pages de propriétés & $$) ;%                               ;%

%                         %                                     %

% ;%

        %               % 9 )                 &

;%

 

$/ ;%                            %

 

% %

                          .                 91 &

;% % %

 

. %

%

$%

&

%/&

     
 

                       %$                 1 %

% %

%

. &%

 

           %                  ;%$ &%                             % $$                     &                                 /

         !                                   0                        SelectionChanged

%                                                    %                                                 %                                                . % % 9

                      Count              SelectedControls       $                                 %             % 1

%                                      %                                                                                                  .                 %

%8 %                                                                                              #

                                            ;% %                                               /                                                 = % %

                     %                                                   8             .                    A               ;%                  %                                      =

%1BackColor% %Label

                                        %8;%                    &@ %                                      1                               =                             % %

                            %                                                   8             .         &                                %A                   %

                                           =%1 % %                                                     Label %                                     Caption

                      %                   = =                    /                             % &%               %                                   %

&%                                                          ) ;% % % 9                                                               %

SelectionChanged         1                                        )                     %

                                .1 );% $ ;%                                                  %                                                     I

3Appliquer                                                                                                                 True’ !Changed

%                           1 + % "                   ;% &%                %                      %                                      % % %

. % 9                                                                                     % True 1                                           Changed         & /’

PropertyPage            & 8             %%            @                               ;%                                  % %                    %

%                                              )                 . %                    9$                       =                    % );%                                     $$)

8 . % $ 1 & /’ PropertyPage) DinoName%Age & 8 + . % % 9 % #

Private Sub txtDinoName_Changed()

      Changed = True

End

Private Sub cboAge_Changed()

      Changed = True End Sub

! 9;%                                                                                                                         8%=;% &PropertyPage.Changed =

TrueG

 

I 5 %                   9                              %                                       ’             ;% %8 &                   %8                    %         =

                  .           % 9< %                $% %               %                 &       %         %                  ;%                     %                                   5

                                                                & %                %                                                                               % .% %

            % ;%               %                  9

%

     

G&Changed = True

%8$

% & / .

1 % % /%

Appliquer

2 % .                                 $          %

/O

% ;%            &%

% ;% % OK &

%               A

&                  $          %                /O

%

     

             $                                                     1 & /’PropertyPage % %                           ;% ;%                        %

)                                           /% Appliquer                 /O                            % Pages de propriétés.                                 )

&ApplyChanges ;%                                          &%                               % ;%%.)                                                                 .%

$                     /O                           %

/0                          ApplyChanges

&

% ’ PropertyPage

& ApplyChanges &

 

;% % 9%

                       ;%                %

%

 

&ApplyChanges                    % ;%

&%

%#

                            ;% % /%OK %$

                        ;% % /%Appliquer

/O

%

             5                           % %

/O

% Pages de propriétés

% % & ApplyChanges % ;% & SelectionChanged % % % % %

Age% )%

Private Sub PropertyPage_ApplyChanges()

      Dim vv As Velociraptor

      ‘ définit la propriété DinoName du premier 

‘ contrôle sélectionné seulement

      SelectedControls(0).DinoName = txtDinoName

      For Each vv In SelectedControls

            ‘ transfère la valeur se trouvant sélectionnée 

‘ dans la liste déroulante pour la propriété DinoAge 

‘ à tous les contrôles sélectionnés vv.DinoAge = cboAge.ListIndex

‘ le code ci-dessus fonctionne parce que la valeur  ‘ de chacun des éléments de l’instruction Enum  ‘ est égale à celle de son index dans cboAge.

      Next

End Sub

                         &@                                        %%                1                              =                       1 %                                             .

                              DinoName &                         ;% ;%& %

Age.;% 1                      .                            ;% 1 %

0ApplyChanges

3                                                          <           %.                          &@ %% ;% &                         %                  &

ApplyChanges             Text    %                             )O .                                        %

                          &%                 % %                                      Age %8 %                    %

5                                                                                  1 &%               %                                                   % ;% %                   =

’                                                         %Property Let 4%Property Set6. %                                    9%

       %                     &        %               &                         ApplyChanges      )                     %

1 %                     On Error Resume Next.              1                              Err.Number A );%

%                /                     % %                    %

V% %                          %                    % #

0                             9&                           ApplyChanges

             $$)9%                               &         %.                $Q ;% &%                    %                                     ;% &                           %

                         9 $ % %                                      ;%              % &            %

3                   9                                         %True1Changed& /’PropertyPage

#                                  7 & %                           % %                 :

 

K $ ;% %                                       9 ’%                                                                1                        ’                                                   .

% % 9%                                         /O                                % Connexion des pages de propriétés %                  / %

              8                     %                                                                                                    ;% % % 9%$ %

V%              % %                  % $                       O               /O                                        % Pages de propriétés%

&% . ) % ;% % 9 % O % /O %

 7              3                                  $ = Explorateur de projet. %/ < ;%9 %                                                       % %

$ =

7                            %@9%F4 % %                                 $ = Propriétés

7                       3%/ < ;%9 %                                          PropertyPages 4%%                                  %

% % /%Sélection6 % %      /O           % Connexion des pages de propriétés

7                             )9 );%                                                                                             ;% %% 9$O;%

%.;% % .% /O % Pages de propriétés

H7            K                 9 /%                     Ordre des pages %                                                            &                            P % 9

                                                   O                           /O                                % Pages de propriétés. %                          ;%9 %

OK

 

*                                         %                  % %                        : % %

 

K                                                $                                                     ;%%= $1

Propriétés K                                                   % = % /’.                                     & /’ Fonts.

$ =

.                                                             %&%                                                                  2 %%

/ %                                    % .%=                               %                                     & /’ .                            %

/%                       /              & %

%

5 %9%                                                                                          @Font. OLE_COLOR. %Picture. + % "

& %                                            ;%                       1 %                                              StandardFont. StandardColor. %

StandardPicture

                                                !                                     ’

 7                3 %                         $ = Explorateur de projet. ;%9                                /%                                                     % %

                                                $ =UserControl % %                                                        %                8% .                      ;%9

                        %Code % %                         $ =

7               3                                                    % Outils. ;%9% Attributs de procédure %% /O

 

%Attributs de procédure.

%

;%9 % Avancés %                                                        /O

7

3                            9 Nom. ;%9%

                           ;% % % 9                                1%

7

5                         9

        %%                                    Utiliser cette page

 

$ = Propriétés.

                <                 %. %                              ;%9 % Appliquer%

%OK

 

4                         EditProperty

+ % "                         %                       &                          % %                                 1%             =

+% % 9 %<= $                                                                                                                          %&%;%%

=                                                                                               % %                                %

&%           %                                                        3                                               . %                % 9%                 &

EditProperty %                                 ;%

V%            &%                                  % ;% % /% Sélection %%                                                  ;%                                        1%

.Q &EditProperty                                             %                   % ;%&

Q                                                                      +% % 9%

                        & %PropertyName        &

EditProperty %                     $

/% Sélection;%

&EditProperty %

               $                %/ $$                                               1

                               .                              %

                                                     8                                             ;%

%                                        +% % 9                      8

#

- 5                                       ;%                 %

                             .                           $ % %

               $$)                         % %                              %

-

%                                                       .                   $Q ;% %

            )                                 / 1

$

(                                                                                     5

Propriétés

0 %                                 ;% %                        % 9

$$) %                                                                             $ = Propriétés

                %                                            % & $$)&%%                                                                                                                  %

                         / % %                                         ;%                                   % %

& A 1 $ =Propriétés

3                                  % Attributs de procédure.                        / 1                       %                    %Outils. ;%9 %

                                    ;% % % 9                        ;%                 ;%9                        % % /%                                      Avancées. )9

&Ne pas afficher$ =Propriétés. % % Appliquer

+ $                                 %                     % %

 

+ % "                     $%                                                                                              # StandardFont. StandardColor.

                         StandardPicture 5 %9                                                                                 @Font. OLE_COLOR. %

 

Picture. $ = Propriétés

% $ .+ % "                                      M

Pages de propriétés K                 9

+ % "                                                 %               ;%

                     %               ;%                                             1 /O

                     % /                      %                     4             8           &%

6 % ’%                                                                                                     1

1

%

;%

 

1%

;%

9                        % %

5

%’% 9

% %

$$)

% M%

1

 

%

/O                                   % Pages de propriétés

% %                          " %

           ;%%              %

                 PropertyPages              .

                                     ;% %                                    M%                    %

H

 
         

 

              8             .               $% %                                                    $ = Propriétés         /O                                 %

Pages de propriétés % M)@ ) ;%                                                           +                          . ;%                             % %

 

A $$                                      %%                                $ = Propriétés

,

%StripeColorM)@ ) ;%

                       +                                        =                                                    A 1 $                                                            $ =

Propriétés            /O                            % Pages de propriétés#

Private mStripeColor As OLE_COLOR

Public Property Get StripeColor() As OLE_COLOR

StripeColor = mStripeColor

End Property

Public Property Let StripeColor( _       ByVal NewColor As OLE_COLOR) mStripeColor = NewColor

End Property

R

’ %

+ % "                                           & %                    DC                       DCX.B @ 5                         9.5@/8                        .

,

& %;%                                                        %84                        %8                                                 //                             ) 6

                                             )                                                                          C              $.

                                     $$                                   $$                                                                                      13 DC

             )% %                                        A% . & $$;%&%                                                        %%

& % %                                                             DCX.C5CV. 0C3"

3             DC7       F )+ % "   ,. 3          . 5

 GGG.I,

                     %&                                                                                         %%8%$%+".

                                         %                  ) ;%               %                                                                                        DC 3 DC

3&% %A                                                         %                       ;%                                     .                                          (// -

4             ;% G      Y6            %             & /’         DC           %

% %                                                                                           & 8 %                                                      &        1 &

                   %               ;% ’&                        %                                                   8                                ) ;%

            70. A                                               .BU5                    .                      B             @ GGH.,

                     %&                                                                                                          5C . %                      %%

8

) #77                                       $           .                                0! D!DKU!"2 %                                                %               <

$              B            F

) #77FFF                  $           7 7 )7      .               C              $ % % ;% )              DC

I



D% 9                                                            %                 Coolbar 4             /            % &               Composant… %             %Projet.

%Microsoft Windows Common Controls-3 6.06 %                                                           /                                           /

 ,


84