TreeNodeStyle.MergeWith メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TreeNodeStyle.MergeWith メソッドの意味・解説 

TreeNodeStyle.MergeWith メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

指定した Style オブジェクトスタイル プロパティ現在の TreeNodeStyle オブジェクトスタイル プロパティ結合します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Overrides Sub MergeWith
 ( _
    s As Style _
)
Dim instance As TreeNodeStyle
Dim s As Style

instance.MergeWith(s)
public override void MergeWith (
    Style s
)
public:
virtual void MergeWith (
    Style^ s
) override
public void MergeWith (
    Style s
)

パラメータ

s

現在のノード設定マージする Style

解説解説
使用例使用例

MergeWith メソッド使用して指定した Style オブジェクトスタイル プロパティを、このメソッド呼び出す TreeNodeStyle オブジェクトスタイル プロパティ結合する方法次のコード例示します設定されていない TreeNodeStyle プロパティだけが置き換えられることに注意してください

<%@ Page Language="VB" %>

<script runat="server">

  Sub MergeButton_Click(ByVal sender As
 Object, ByVal e As EventArgs)

    ' Combine the leaf node styles of the TreeNodeOne TreeView and the
 
    ' TreeViewResults TreeView.
    TreeViewResults.LeafNodeStyle.MergeWith(TreeViewOne.LeafNodeStyle)

  End Sub

  Sub ResetButton_Click(ByVal sender As
 Object, ByVal e As EventArgs)

    ' Reset the LeafNodeStyle of the TreeViewResults TreeView.
    TreeViewResults.LeafNodeStyle.Reset()

  End Sub

</script>

<html>
  <body>  
    <form runat="server">
    
      <h3>TreeNodeStyle MergeWith Example</h3>
      
      <table cellspacing="30">
        
        <tr>
        
          <th>
          
            TreeView One
          
          </th>
          
          <th>
          
            TreeView Result
          
          </th>
        
        </tr>
        
        <tr valign="top">
        
          <td>
          
            <!-- Set the styles for the
 leaf nodes declaratively. -->
            <asp:TreeView id="TreeViewOne"
              InitialExpandDepth="4" 
              LeafNodeStyle-BackColor="Yellow"
              LeafNodeStyle-Font-Bold="true"  
              LeafNodeStyle-ForeColor="Black"  
              runat="server">
         
              <Nodes>
        
                <asp:TreeNode Text="Table of Contents"
                  SelectAction="None">
             
                  <asp:TreeNode Text="Chapter One">
            
                    <asp:TreeNode Text="Section 1.0">
              
                      <asp:TreeNode Text="Topic 1.0.1"/>
                      <asp:TreeNode Text="Topic 1.0.2"/>
                      <asp:TreeNode Text="Topic 1.0.3"/>
              
                    </asp:TreeNode>
              
                  </asp:TreeNode>
            
                </asp:TreeNode>
        
              </Nodes>
        
            </asp:TreeView>
          
          </td>
          
          <td>
          
            <!-- Set the styles for the
 leaf nodes declaratively. -->
            <asp:TreeView id="TreeViewResults"
              InitialExpandDepth="4" 
              LeafNodeStyle-ForeColor="Green"  
              runat="server">
         
              <Nodes>
        
                <asp:TreeNode Text="Table of Contents"
                  SelectAction="None">
             
                  <asp:TreeNode Text="Chapter One">
            
                    <asp:TreeNode Text="Section 1.0">
              
                      <asp:TreeNode Text="Topic 1.0.1"/>
                      <asp:TreeNode Text="Topic 1.0.2"/>
                      <asp:TreeNode Text="Topic 1.0.3"/>
              
                    </asp:TreeNode>
              
                  </asp:TreeNode>
            
                </asp:TreeNode>
        
              </Nodes>
        
            </asp:TreeView>
          
          </td>
        
        </tr>
        
        <tr>
        
          <td>
          
            <asp:Button ID="MergeNodeStyleButton"
 
              Text="Merge LeafNodeStyle"
              OnClick="MergeButton_Click" 
              runat="server"/>
          
          </td>
          
          <td>
          
            <asp:Button ID="ResetButton" 
              Text="Reset LeafNodeStyle"
              OnClick="ResetButton_Click" 
              runat="server"/>
          
          </td>
        
        </tr>
      
      </table>
       
    </form>
  </body>
</html>

<%@ Page Language="C#" %>

<script runat="server">

  void MergeButton_Click(Object sender, EventArgs e)
  {

    // Combine the leaf node styles of the TreeNodeOne TreeView and
 the 
    // TreeViewResults TreeView.
    TreeViewResults.LeafNodeStyle.MergeWith(TreeViewOne.LeafNodeStyle);

  }

  void ResetButton_Click(Object sender, EventArgs e)
  {

    // Reset the LeafNodeStyle of the TreeViewResults TreeView.
    TreeViewResults.LeafNodeStyle.Reset();

  }

</script>

<html>
  <body>  
    <form runat="server">
    
      <h3>TreeNodeStyle MergeWith Example</h3>
      
      <table cellspacing="30">
        
        <tr>
        
          <th>
          
            TreeView One
          
          </th>
          
          <th>
          
            TreeView Result
          
          </th>
        
        </tr>
        
        <tr valign="top">
        
          <td>
          
            <!-- Set the styles for the leaf nodes declaratively.
 -->
            <asp:TreeView id="TreeViewOne"
              InitialExpandDepth="4" 
              LeafNodeStyle-BackColor="Yellow"
              LeafNodeStyle-Font-Bold="true"  
              LeafNodeStyle-ForeColor="Black"  
              runat="server">
         
              <Nodes>
        
                <asp:TreeNode Text="Table of Contents"
                  SelectAction="None">
             
                  <asp:TreeNode Text="Chapter One">
            
                    <asp:TreeNode Text="Section 1.0">
              
                      <asp:TreeNode Text="Topic 1.0.1"/>
                      <asp:TreeNode Text="Topic 1.0.2"/>
                      <asp:TreeNode Text="Topic 1.0.3"/>
              
                    </asp:TreeNode>
              
                  </asp:TreeNode>
            
                </asp:TreeNode>
        
              </Nodes>
        
            </asp:TreeView>
          
          </td>
          
          <td>
          
            <!-- Set the styles for the leaf nodes declaratively.
 -->
            <asp:TreeView id="TreeViewResults"
              InitialExpandDepth="4" 
              LeafNodeStyle-ForeColor="Green"  
              runat="server">
         
              <Nodes>
        
                <asp:TreeNode Text="Table of Contents"
                  SelectAction="None">
             
                  <asp:TreeNode Text="Chapter One">
            
                    <asp:TreeNode Text="Section 1.0">
              
                      <asp:TreeNode Text="Topic 1.0.1"/>
                      <asp:TreeNode Text="Topic 1.0.2"/>
                      <asp:TreeNode Text="Topic 1.0.3"/>
              
                    </asp:TreeNode>
              
                  </asp:TreeNode>
            
                </asp:TreeNode>
        
              </Nodes>
        
            </asp:TreeView>
          
          </td>
        
        </tr>
        
        <tr>
        
          <td>
          
            <asp:Button ID="MergeNodeStyleButton" 
              Text="Merge LeafNodeStyle"
              OnClick="MergeButton_Click" 
              runat="server"/>
          
          </td>
          
          <td>
          
            <asp:Button ID="ResetButton" 
              Text="Reset LeafNodeStyle"
              OnClick="ResetButton_Click" 
              runat="server"/>
          
          </td>
        
        </tr>
      
      </table>
       
    </form>
  </body>
</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TreeNodeStyle クラス
TreeNodeStyle メンバ
System.Web.UI.WebControls 名前空間
Style クラス
CopyFrom



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TreeNodeStyle.MergeWith メソッド」の関連用語

TreeNodeStyle.MergeWith メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TreeNodeStyle.MergeWith メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS