主婦と.NETと犬のぶろぐ

奥様 と プログラム と お犬様 の 楽しい日常

目次

Blog 利用状況

ニュース

書庫

日記カテゴリ

Splitter(System.Windows.Forms.Splitter)

”以前のバージョンと互換性を維持するためだけに用意されて”いる Splitter です。
ぐはぁ。
SplitContainer と似たような事をやろうとすると結構めんどくさいー
もっと本格的にやるなら、カスタムコントロール化して Panel やら Orientation やらを
包含したクラスを作る方がいいんでしょうけど、SplitContainer があるのに極めて意味がないのでやめました。

■参考文献
Splitter クラス

■実行画像
めんどくさすぎる。。。もう Splitter には戻れない。。。
SplitContainer

Public Class SplitterTest

Private m_splitter As Splitter Private m_panel1 As Panel Private m_panel2 As Panel Private m_splitterOrientation As Orientation
Private Sub SplitterTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Controls.Clear() Me.m_splitterOrientation = Orientation.Vertical
Me.m_panel2 = New Panel() Me.Controls.Add(Me.m_panel2) With Me.m_panel2 .BackColor = Color.LightBlue .Dock = DockStyle.Fill End With
Me.m_splitter = New Splitter() Me.Controls.Add(Me.m_splitter) With Me.m_splitter .BorderStyle = BorderStyle.Fixed3D ' 左側の最少サイズ .MinExtra = 100 ' 右側の最少サイズ .MinSize = 50 .Dock = DockStyle.Left ' イベント AddHandler .SplitterMoved, AddressOf Splitter_MovedOrMoving AddHandler .SplitterMoving, AddressOf Splitter_MovedOrMoving End With
Me.m_panel1 = New Panel() Me.Controls.Add(Me.m_panel1) With Me.m_panel1 .BackColor = Color.LightYellow .Dock = DockStyle.Left End With
' 分割線の位置 Me.m_splitter.SplitPosition = 100
' 左側に ComboBox ' BorderStyle Dim borderStyleCombo As ComboBox = New ComboBox() Me.m_panel1.Controls.Add(borderStyleCombo) With borderStyleCombo .Dock = DockStyle.Top .DropDownStyle = ComboBoxStyle.DropDownList .Items.Add(BorderStyle.Fixed3D) .Items.Add(BorderStyle.FixedSingle) .Items.Add(BorderStyle.None) .SelectedItem = Me.m_splitter.BorderStyle AddHandler .SelectedIndexChanged, AddressOf borderStyleCombo_SelectedIndexChanged End With ' Orientation Dim orientationCombo As ComboBox = New ComboBox() Me.m_panel1.Controls.Add(orientationCombo) With orientationCombo .Dock = DockStyle.Top .DropDownStyle = ComboBoxStyle.DropDownList .Items.Add(Orientation.Vertical) .Items.Add(Orientation.Horizontal) .SelectedItem = Me.m_splitterOrientation AddHandler .SelectedIndexChanged, AddressOf orientationCombo_SelectedIndexChanged End With
' 右側に 中さん Dim nakasan As PictureBox = New PictureBox() Me.m_panel2.Controls.Add(nakasan) With nakasan .Image = My.Resources.中さん .Dock = DockStyle.Fill .SizeMode = PictureBoxSizeMode.AutoSize End With
End Sub
Private Sub borderStyleCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Dim combo As ComboBox = DirectCast(sender, ComboBox) Me.m_splitter.BorderStyle = DirectCast(combo.SelectedItem, BorderStyle) End Sub
Private Sub orientationCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Dim nowOrientation As Orientation = Me.m_splitterOrientation Me.m_splitterOrientation = DirectCast(IIf(nowOrientation = Orientation.Horizontal, _ Orientation.Vertical, _ Orientation.Horizontal), Orientation) If Me.m_splitterOrientation = Orientation.Horizontal Then ' 上下分割 Me.m_panel1.Dock = DockStyle.Top Me.m_splitter.Dock = DockStyle.Top Else ' 左右分割 Me.m_panel1.Dock = DockStyle.Left Me.m_splitter.Dock = DockStyle.Left End If Me.m_splitter.SplitPosition = 100 End Sub
Private Sub Splitter_MovedOrMoving(ByVal sender As Object, ByVal e As SplitterEventArgs) System.Diagnostics.Debug.WriteLine("左上隅 X 座標:" & e.SplitX.ToString()) System.Diagnostics.Debug.WriteLine("左上隅 Y 座標:" & e.SplitY.ToString()) System.Diagnostics.Debug.WriteLine("マウスポインタ X 座標:" & e.X.ToString()) System.Diagnostics.Debug.WriteLine("マウスポインタ Y 座標:" & e.Y.ToString()) End Sub End Class

投稿日時 : 2007年3月30日 9:51

Feedback

# re: Splitter(System.Windows.Forms.Splitter) 2007/03/30 9:53 中博俊

カコイイ人が映ってますね(w

# re: Splitter(System.Windows.Forms.Splitter) 2007/03/30 10:41 なおこ(・∀・)

>> 中さん
そうですねw

# re: Splitter(System.Windows.Forms.Splitter) 2007/03/30 12:54 渋木宏明(ひどり)

個人的には、Splitter の方が楽だけどなぁ (^^;
SplitterContainer って無駄に Panel 使うし。

# re: Splitter(System.Windows.Forms.Splitter) 2007/03/30 13:01 なおこ(・∀・)

>> ひどりさん
ふむ。。。
私の場合、Splitter を使ってちょうど SplitContainer と似たような事を
いつも自分でやろうとしていたので
あらかじめ用意されてる Panel 達も邪魔とは思わないのかもしれません。

# re: Splitter(System.Windows.Forms.Splitter) 2007/03/30 19:15 通りすがり

SplitContainer を使うと Form.ActiveControl がちょっと期待ハズレになってしまう点にお気をつけあれ。

# re: Splitter(System.Windows.Forms.Splitter) 2007/04/02 13:31 なおこ(・∀・)

>> 通りすがりさん
ActiveControl プロパティを使うようなプログラムをあまり組んでませんので知りませんでした。
勉強になります。情報ありがとうございます。

# mViONcGoRAHMlW 2011/11/28 19:52 http://www.laurenslinens.com/

Hooray! the one who wrote is a cool guy..!

# vqAuegzULtwlnwsU 2011/12/12 18:45 http://www.birthcontrolremedy.com/birth-control/cl

Comrade kill yourself.

# QNWsbZXyEZI 2011/12/16 0:21 http://www.circalighting.com/

Unbelievable. Class..!

# This article will help the internet visitors for creating new blog or even a blog from start to end. 2021/09/06 3:32 This article will help the internet visitors for c

This article will help the internet visitors for creating new blog
or even a blog from start to end.

# This article will help the internet visitors for creating new blog or even a blog from start to end. 2021/09/06 3:33 This article will help the internet visitors for c

This article will help the internet visitors for creating new blog
or even a blog from start to end.

# This article will help the internet visitors for creating new blog or even a blog from start to end. 2021/09/06 3:34 This article will help the internet visitors for c

This article will help the internet visitors for creating new blog
or even a blog from start to end.

# I am curious to find out what blog system you have been using? I'm experiencing some minor security problems with my latest website and I'd like to find something more risk-free. Do you have any recommendations? quest bars http://bitly.com/3jZgEA2 quest 2021/09/11 13:13 I am curious to find out what blog system you have

I am curious to find out what blog system you have been using?
I'm experiencing some minor security problems with my
latest website and I'd like to find something more risk-free.
Do you have any recommendations? quest bars http://bitly.com/3jZgEA2 quest bars

# Hi, i believe that i noticed you visited my blog thus i got here to go back the desire?.I'm attempting to in finding issues to improve my web site!I suppose its adequate to make use of a few of your ideas!! 2021/10/25 22:14 Hi, i believe that i noticed you visited my blog

Hi, i believe that i noticed you visited my blog thus i
got here to go back the desire?.I'm attempting to in finding issues to
improve my web site!I suppose its adequate to make use of a few of your ideas!!

# Hello colleagues, how is all, and what you want to say about this article, in my view its actually amazing for me. 2021/11/22 21:28 Hello colleagues, how is all, and what you want to

Hello colleagues, how is all, and what you want to say about this article,
in my view its actually amazing for me.

# Hello colleagues, how is all, and what you want to say about this article, in my view its actually amazing for me. 2021/11/22 21:29 Hello colleagues, how is all, and what you want to

Hello colleagues, how is all, and what you want to say about this article,
in my view its actually amazing for me.

# Hello colleagues, how is all, and what you want to say about this article, in my view its actually amazing for me. 2021/11/22 21:29 Hello colleagues, how is all, and what you want to

Hello colleagues, how is all, and what you want to say about this article,
in my view its actually amazing for me.

# Hello colleagues, how is all, and what you want to say about this article, in my view its actually amazing for me. 2021/11/22 21:30 Hello colleagues, how is all, and what you want to

Hello colleagues, how is all, and what you want to say about this article,
in my view its actually amazing for me.

# Good blog you have here.. It's hard to find quality writing like yours these days. I honestly appreciate people like you! Take care!! 2021/12/13 19:49 Good blog you have here.. It's hard to find qualit

Good blog you have here.. It's hard to find quality writing like yours these days.
I honestly appreciate people like you! Take care!!

# Sweet blog! I found it while searching on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Appreciate it 2022/03/25 8:19 Sweet blog! I found it while searching on Yahoo Ne

Sweet blog! I found it while searching on Yahoo News.
Do you have any suggestions on how to get
listed in Yahoo News? I've been trying for a while but
I never seem to get there! Appreciate it

# Sweet blog! I found it while searching on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Appreciate it 2022/03/25 8:20 Sweet blog! I found it while searching on Yahoo Ne

Sweet blog! I found it while searching on Yahoo News.
Do you have any suggestions on how to get
listed in Yahoo News? I've been trying for a while but
I never seem to get there! Appreciate it

# Sweet blog! I found it while searching on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Appreciate it 2022/03/25 8:21 Sweet blog! I found it while searching on Yahoo Ne

Sweet blog! I found it while searching on Yahoo News.
Do you have any suggestions on how to get
listed in Yahoo News? I've been trying for a while but
I never seem to get there! Appreciate it

# Sweet blog! I found it while searching on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Appreciate it 2022/03/25 8:22 Sweet blog! I found it while searching on Yahoo Ne

Sweet blog! I found it while searching on Yahoo News.
Do you have any suggestions on how to get
listed in Yahoo News? I've been trying for a while but
I never seem to get there! Appreciate it

タイトル
名前
Url
コメント