Condividi tramite


HelpProvider.SetHelpNavigator(Control, HelpNavigator) Metodo

Definizione

Specifica il comando della Guida da utilizzare quando si recupera la Guida dal relativo file per il controllo specificato.

public:
 virtual void SetHelpNavigator(System::Windows::Forms::Control ^ ctl, System::Windows::Forms::HelpNavigator navigator);
public virtual void SetHelpNavigator (System.Windows.Forms.Control ctl, System.Windows.Forms.HelpNavigator navigator);
abstract member SetHelpNavigator : System.Windows.Forms.Control * System.Windows.Forms.HelpNavigator -> unit
override this.SetHelpNavigator : System.Windows.Forms.Control * System.Windows.Forms.HelpNavigator -> unit
Public Overridable Sub SetHelpNavigator (ctl As Control, navigator As HelpNavigator)

Parametri

ctl
Control

Oggetto Control per il quale impostare la parola chiave della Guida.

navigator
HelpNavigator

Uno dei valori di HelpNavigator.

Eccezioni

Il valore di navigator non è uno dei valori di HelpNavigator.

Esempio

Nell'esempio di codice seguente viene illustrato l'uso del SetHelpNavigator metodo .

Per eseguire questo esempio, inserirlo in un modulo contenente un HelpProvider denominato HelpProvider1 e un TextBox denominato TextBox1. L'esempio richiede l'esistenza di un file della Guida denominato input.chm nella directory C:\Windows.

   //Declare the HelpProvider.
internal:
   System::Windows::Forms::HelpProvider^ HelpProvider1;

private:
   void InitializeHelpProvider()
   {
      // Construct the HelpProvider Object.
      this->HelpProvider1 = gcnew System::Windows::Forms::HelpProvider;
      
      // Set the HelpNamespace property to the Help file for 
      // HelpProvider1.
      this->HelpProvider1->HelpNamespace = "c:\\windows\\input.chm";
      
      // Specify that the Help provider should open to the table
      // of contents of the Help file.
      this->HelpProvider1->SetHelpNavigator( TextBox1, HelpNavigator::TableOfContents );
   }

//Declare the HelpProvider.
internal System.Windows.Forms.HelpProvider HelpProvider1;

private void InitializeHelpProvider()
{
    // Construct the HelpProvider Object.
    this.HelpProvider1 = new System.Windows.Forms.HelpProvider();

    // Set the HelpNamespace property to the Help file for 
    // HelpProvider1.
    this.HelpProvider1.HelpNamespace = "c:\\windows\\input.chm";

    // Specify that the Help provider should open to the table
    // of contents of the Help file.
    this.HelpProvider1.SetHelpNavigator(TextBox1, 
        HelpNavigator.TableOfContents);
}

'Declare the HelpProvider.
Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider


Private Sub InitializeHelpProvider()

    ' Construct the HelpProvider Object.
    Me.HelpProvider1 = New System.Windows.Forms.HelpProvider

    ' Set the HelpNamespace property to the Help file for 
    ' HelpProvider1.
    Me.HelpProvider1.HelpNamespace = "c:\windows\input.chm"

    ' Specify that the Help provider should open to the table
    ' of contents of the Help file.
    Me.HelpProvider1.SetHelpNavigator(TextBox1, _
        HelpNavigator.TableOfContents)

End Sub

Si applica a

Vedi anche