主婦と.NETと犬のぶろぐ

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

目次

Blog 利用状況

ニュース

書庫

日記カテゴリ

Button(System.Windows.Forms.Button)

Button のメンバをぼーっと見てたら、ControlAdded やら ControlRemoved なんてのがありました。
えっ。Button にコントロール貼り付けられんのかー。って事でやってみました。

Image のボタンには敬愛する中先生の画像を使わせていただきました。
TextImageRelation でいろいろ遊んでみたら、結構おもしろい。

クリックしたらコンテキストメニューを出すなんてのは、滅多に使うもんじゃないんですが、
以前のお客さんがこういう UI に固執してたのを思い出して実装してみました。

■参考文献
Button クラス

■実行画像
Button2 に マウスポインタを合わせた時
Button Button2 に マウスポインタを合わせた時

Button4 を クリックした時
Button Button4 を クリックした時

Public Class ButtonTest
    Private Sub ButtonTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Image ボタン
        Me.Button3.Text = "中さん"
        Me.Button3.Image = My.Resources.中さん
        Me.Button3.Height = My.Resources.中さん.Height + 10
        Me.Button3.Width = My.Resources.中さん.Width + 10
        ' Image と Text の相対位置を指定する
        Me.Button3.TextImageRelation = TextImageRelation.TextAboveImage
        ' フラットなボタン
        Me.Button2.FlatStyle = FlatStyle.Popup
        Dim tip As ToolTip = New ToolTip()
        tip.SetToolTip(Me.Button2, "マウスポインタを乗っけると外観が変化したよねー")
        ' Button に Label をはっつける
        Dim lb As Label = New Label()
        lb.Size = New System.Drawing.Size(10, 10)
        lb.BackColor = System.Drawing.Color.Blue
        lb.Location = New System.Drawing.Point(3, 3)
        Me.Button1.Controls.Add(lb)
    End Sub
    Private Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
        ' Button を クリックしたらコンテキストメニューを出す
        Dim cntext As ContextMenu = New ContextMenu
        Dim onClickEvent As EventHandler = _
        New Eventhandler(AddressOf Me.MenuItemOnClick)
        cntext.MenuItems.Add(New MenuItem("ふじこ", onClickEvent))
        cntext.MenuItems.Add(New MenuItem("エデン", onClickEvent))
        cntext.Show(Me.Button4, New System.Drawing.Point(0, Me.Button4.Height))
    End Sub
    Private Sub MenuItemOnClick(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim senderMenuItem As MenuItem = DirectCast(sender, MenuItem)
        MessageBox.Show(senderMenuItem.Text & "がクリックされました")
    End Sub
End Class

投稿日時 : 2006年12月8日 12:09

Feedback

# re: Button(System.Windows.Forms.Button) 2006/12/08 12:46 じゃんぬねっと

Control は、すべてそうだったような...

# re: Button(System.Windows.Forms.Button) 2006/12/08 13:00 なおこ(・∀・)

>> じゃんぬさん
ですね。
http://msdn2.microsoft.com/ja-jp/library/system.windows.forms.control.controls(VS.80).aspx
Control から派生してるから当然か。

# re: 業務連絡:12/9の集合時間は10:00 2006/12/08 14:01 中の技術日誌ブログ

re: 業務連絡:12/9の集合時間は10:00

# re: Button(System.Windows.Forms.Button) 2006/12/08 17:02 えムナウ

ControlAddedはControlが持っています。
Imageに画像はっつけても発生しませんよ。

Button3.Controls.Add(new TextBox())
なんてやると楽しいかも。

# I believe everything composed was actually very logical. However, what about this? what if you were to write a awesome title? I ain't saying your information isn't good, however suppose you added a post title that grabbed folk's attention? I mean Button( 2019/05/04 11:13 I believe everything composed was actually very lo

I believe everything composed was actually very logical.
However, what about this? what if you were to write a awesome title?
I ain't saying your information isn't good, however suppose you added a post title that grabbed folk's attention? I mean Button(System.Windows.Forms.Button) is kinda boring.
You ought to glance at Yahoo's front page and watch how they create post
titles to get people to open the links. You might
add a related video or a picture or two to get readers excited about what you've written. Just
my opinion, it would make your posts a little livelier.

# An outstanding share! I've just forwarded this onto a colleague who has been conducting a little research on this. And he in fact bought me lunch simply because I discovered it for him... lol. So allow me to reword this.... Thanks for the meal!! But ye 2019/05/08 22:52 An outstanding share! I've just forwarded this ont

An outstanding share! I've just forwarded this
onto a colleague who has been conducting a little research on this.
And he in fact bought me lunch simply because
I discovered it for him... lol. So allow me to reword this....

Thanks for the meal!! But yeah, thanx for spending some time
to talk about this matter here on your internet site.

# Hi terrific blog! Does running a blog such as this take a lot of work? I've very little expertise in programming however I was hoping to start my own blog in the near future. Anyhow, should you have any suggestions or techniques for new blog owners plea 2019/09/04 5:16 Hi terrific blog! Does running a blog such as this

Hi terrific blog! Does running a blog such as this take a lot of work?

I've very little expertise in programming however I was hoping to start my own blog
in the near future. Anyhow, should you have any suggestions or techniques for new blog owners
please share. I understand this is off topic however I just had to
ask. Kudos!

# Hi terrific blog! Does running a blog such as this take a lot of work? I've very little expertise in programming however I was hoping to start my own blog in the near future. Anyhow, should you have any suggestions or techniques for new blog owners plea 2019/09/04 5:17 Hi terrific blog! Does running a blog such as this

Hi terrific blog! Does running a blog such as this take a lot of work?

I've very little expertise in programming however I was hoping to start my own blog
in the near future. Anyhow, should you have any suggestions or techniques for new blog owners
please share. I understand this is off topic however I just had to
ask. Kudos!

# Hi terrific blog! Does running a blog such as this take a lot of work? I've very little expertise in programming however I was hoping to start my own blog in the near future. Anyhow, should you have any suggestions or techniques for new blog owners plea 2019/09/04 5:18 Hi terrific blog! Does running a blog such as this

Hi terrific blog! Does running a blog such as this take a lot of work?

I've very little expertise in programming however I was hoping to start my own blog
in the near future. Anyhow, should you have any suggestions or techniques for new blog owners
please share. I understand this is off topic however I just had to
ask. Kudos!

# Hi terrific blog! Does running a blog such as this take a lot of work? I've very little expertise in programming however I was hoping to start my own blog in the near future. Anyhow, should you have any suggestions or techniques for new blog owners plea 2019/09/04 5:19 Hi terrific blog! Does running a blog such as this

Hi terrific blog! Does running a blog such as this take a lot of work?

I've very little expertise in programming however I was hoping to start my own blog
in the near future. Anyhow, should you have any suggestions or techniques for new blog owners
please share. I understand this is off topic however I just had to
ask. Kudos!

# Everyone loves what you guys tend to be up too. This sort of clever work and exposure! Keep up the excellent works guys I've added you guys to my own blogroll. 2021/08/24 1:00 Everyone loves what you guys tend to be up too. Th

Everyone loves what you guys tend to be up too. This sort of clever work and exposure!
Keep up the excellent works guys I've added you guys to my own blogroll.

# Everyone loves what you guys tend to be up too. This sort of clever work and exposure! Keep up the excellent works guys I've added you guys to my own blogroll. 2021/08/24 1:01 Everyone loves what you guys tend to be up too. Th

Everyone loves what you guys tend to be up too. This sort of clever work and exposure!
Keep up the excellent works guys I've added you guys to my own blogroll.

# Everyone loves what you guys tend to be up too. This sort of clever work and exposure! Keep up the excellent works guys I've added you guys to my own blogroll. 2021/08/24 1:02 Everyone loves what you guys tend to be up too. Th

Everyone loves what you guys tend to be up too. This sort of clever work and exposure!
Keep up the excellent works guys I've added you guys to my own blogroll.

# Everyone loves what you guys tend to be up too. This sort of clever work and exposure! Keep up the excellent works guys I've added you guys to my own blogroll. 2021/08/24 1:03 Everyone loves what you guys tend to be up too. Th

Everyone loves what you guys tend to be up too. This sort of clever work and exposure!
Keep up the excellent works guys I've added you guys to my own blogroll.

# I every time used to study piece of writing in news papers but now as I am a user of internet so from now I am using net for posts, thanks to web. 2021/08/25 22:25 I every time used to study piece of writing in new

I every time used to study piece of writing in news papers but now as I am a user of internet so
from now I am using net for posts, thanks to web.

# I every time used to study piece of writing in news papers but now as I am a user of internet so from now I am using net for posts, thanks to web. 2021/08/25 22:26 I every time used to study piece of writing in new

I every time used to study piece of writing in news papers but now as I am a user of internet so
from now I am using net for posts, thanks to web.

# I every time used to study piece of writing in news papers but now as I am a user of internet so from now I am using net for posts, thanks to web. 2021/08/25 22:27 I every time used to study piece of writing in new

I every time used to study piece of writing in news papers but now as I am a user of internet so
from now I am using net for posts, thanks to web.

# Hi! I know this is somewhat off-topic but I needed to ask. Does operating a well-established website such as yours require a massive amount work? I'm completely new to blogging but I do write in my diary on a daily basis. I'd like to start a blog so I ca 2021/09/02 3:59 Hi! I know this is somewhat off-topic but I needed

Hi! I know this is somewhat off-topic but I needed to ask.

Does operating a well-established website such as yours
require a massive amount work? I'm completely new to blogging but I do write in my diary on a daily basis.
I'd like to start a blog so I can easily share my experience and
thoughts online. Please let me know if you have any kind of ideas or tips for
brand new aspiring blog owners. Appreciate it!

# Hi! I know this is somewhat off-topic but I needed to ask. Does operating a well-established website such as yours require a massive amount work? I'm completely new to blogging but I do write in my diary on a daily basis. I'd like to start a blog so I ca 2021/09/02 4:00 Hi! I know this is somewhat off-topic but I needed

Hi! I know this is somewhat off-topic but I needed to ask.

Does operating a well-established website such as yours
require a massive amount work? I'm completely new to blogging but I do write in my diary on a daily basis.
I'd like to start a blog so I can easily share my experience and
thoughts online. Please let me know if you have any kind of ideas or tips for
brand new aspiring blog owners. Appreciate it!

# Hi! I know this is somewhat off-topic but I needed to ask. Does operating a well-established website such as yours require a massive amount work? I'm completely new to blogging but I do write in my diary on a daily basis. I'd like to start a blog so I ca 2021/09/02 4:01 Hi! I know this is somewhat off-topic but I needed

Hi! I know this is somewhat off-topic but I needed to ask.

Does operating a well-established website such as yours
require a massive amount work? I'm completely new to blogging but I do write in my diary on a daily basis.
I'd like to start a blog so I can easily share my experience and
thoughts online. Please let me know if you have any kind of ideas or tips for
brand new aspiring blog owners. Appreciate it!

# Hi! I know this is somewhat off-topic but I needed to ask. Does operating a well-established website such as yours require a massive amount work? I'm completely new to blogging but I do write in my diary on a daily basis. I'd like to start a blog so I ca 2021/09/02 4:02 Hi! I know this is somewhat off-topic but I needed

Hi! I know this is somewhat off-topic but I needed to ask.

Does operating a well-established website such as yours
require a massive amount work? I'm completely new to blogging but I do write in my diary on a daily basis.
I'd like to start a blog so I can easily share my experience and
thoughts online. Please let me know if you have any kind of ideas or tips for
brand new aspiring blog owners. Appreciate it!

# I am actually delighted to read this website posts which includes plenty of valuable facts, thanks for providing these kinds of information. 2021/10/26 23:43 I am actually delighted to read this website posts

I am actually delighted to read this website posts which includes plenty of
valuable facts, thanks for providing these kinds of information.

# My developer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the expenses. But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am anxious about switching to 2022/03/25 3:16 My developer is trying to persuade me to move to .

My developer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.

But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am anxious about switching to another
platform. I have heard fantastic things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?

Any kind of help would be really appreciated!

# My developer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the expenses. But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am anxious about switching to 2022/03/25 3:17 My developer is trying to persuade me to move to .

My developer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.

But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am anxious about switching to another
platform. I have heard fantastic things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?

Any kind of help would be really appreciated!

# My developer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the expenses. But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am anxious about switching to 2022/03/25 3:18 My developer is trying to persuade me to move to .

My developer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.

But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am anxious about switching to another
platform. I have heard fantastic things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?

Any kind of help would be really appreciated!

# My developer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the expenses. But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am anxious about switching to 2022/03/25 3:19 My developer is trying to persuade me to move to .

My developer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.

But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am anxious about switching to another
platform. I have heard fantastic things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?

Any kind of help would be really appreciated!

タイトル  
名前  
Url
コメント