主婦と.NETと犬のぶろぐ

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

目次

Blog 利用状況

ニュース

書庫

日記カテゴリ

DataGridView(System.Windows.Forms.DataGridView)その1

今日から何回か DataGridView です。
DataGridView は機能がいっぱいありすぎて一日では遊びきれません。
しかも何から手を付けてよいやら...
困ったなぁ...
(特にコントロール関連で)困った時には、えムナウのプログラミングのページ です。

ってことで、
DataGridViewコントロール-内部コントロールの種類(えムナウのプログラミングのページ) にある
画像の"もどき"を、VB で実装してみました。( BindingNavigator は除く...)

■参考文献
DataGridViewコントロール-内部コントロールの種類(えムナウのプログラミングのページ)
DataGridView コントロール (Windows フォーム)
DataGridView クラス
DataGridViewColumn クラス
DataGridViewTextBoxColumn クラス
DataGridViewImageColumn クラス
DataGridViewCheckBoxColumn クラス
DataGridViewComboBoxColumn クラス
DataGridViewLinkColumn クラス
DataGridViewButtonColumn クラス

■実行画像
DataGridView その1

Public Class DataGridViewTest

Private Sub DataGridViewTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Size = New Size(600, 300)
'' TabControl に DataGridView を描画する。 Dim tabCntrl As TabControl = New TabControl Me.Controls.Add(tabCntrl) tabCntrl.Dock = DockStyle.Fill
tabCntrl.TabPages.Clear() ' TabPage の追加 Dim dgView1 As DataGridView = New DataGridView Me.AddTabPage(tabCntrl, "DataGridViewコントロール-内部コントロールの種類", dgView1) Me.DataGridViewコントロール_内部コントロールの種類(dgView1)
End Sub
Private Sub DataGridViewコントロール_内部コントロールの種類(ByVal dgView As DataGridView)
dgView.Columns.Clear() ' Text Dim textCol As DataGridViewTextBoxColumn = New DataGridViewTextBoxColumn textCol.HeaderText = "Text" textCol.Width = 50 dgView.Columns.Add(textCol)
' Image Dim imageCol As DataGridViewImageColumn = New DataGridViewImageColumn imageCol.HeaderText = "Image" imageCol.Width = My.Resources.中さん.Width ' 中さんの幅に合わせる dgView.Columns.Add(imageCol)
' Check Dim checkCol As DataGridViewCheckBoxColumn = New DataGridViewCheckBoxColumn checkCol.HeaderText = "Check" checkCol.Width = 50 dgView.Columns.Add(checkCol)
' Combo Dim comboCol As DataGridViewComboBoxColumn = New DataGridViewComboBoxColumn comboCol.HeaderText = "Combo" comboCol.Width = 100 dgView.Columns.Add(comboCol)
' コンボボックスのデータソースを作る。 Dim comboSource As DataTable = New DataTable("dogkind") comboSource.Columns.Add("kindName", GetType(String)) comboSource.Rows.Add("Shiba") comboSource.Rows.Add("Dachshund")
comboCol.DataSource = comboSource comboCol.DisplayMember = comboSource.Columns(0).ColumnName
' Link Dim linkCol As DataGridViewLinkColumn = New DataGridViewLinkColumn linkCol.HeaderText = "Link" linkCol.LinkColor = Color.LightSeaGreen ' リンクの色を変える linkCol.Width = 100 dgView.Columns.Add(linkCol)
' Button Dim buttonCol As DataGridViewButtonColumn = New DataGridViewButtonColumn buttonCol.HeaderText = "Button" buttonCol.Width = 100 dgView.Columns.Add(buttonCol)
'' 行を追加する Dim index As Integer = dgView.Rows.Add("わんくま", My.Resources.中さん, True, "Shiba", "LinkTest", "ButtonTest") dgView.Rows(index).Height = My.Resources.中さん.Height ' 中さんの高さに合わせる
'' Cell の中身がクリックされた時のイベントハンドラを登録する AddHandler dgView.CellContentClick, AddressOf OnCellContentClick End Sub
' Cell の中身がクリックされた時のイベントハンドラ Private Sub OnCellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) If e.ColumnIndex = 1 AndAlso e.RowIndex = 0 Then MessageBox.Show("中さんがくりっくされました") Else Dim dgView As DataGridView = DirectCast(sender, DataGridView) MessageBox.Show(dgView.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString()) End If End Sub
' TabPage を追加する Private Sub AddTabPage(ByVal tabCntrl As TabControl, _ ByVal tabPageText As String, _ ByVal dgView As DataGridView)
Dim tp As TabPage = New TabPage(tabPageText) tp.Controls.Add(dgView) dgView.Dock = DockStyle.Fill tabCntrl.TabPages.Add(tp) End Sub End Class

投稿日時 : 2006年12月19日 14:35

Feedback

# re: DataGridView(System.Windows.Forms.DataGridView)その1 2006/12/19 18:10 シャノン

いーなー。DataGridView使いたいなー。
今の仕事は .NET 1.1。DataGridしか使えません。
でも「コンボボックスを載せろ」って言われるような予感がしてる。

# re: DataGridView(System.Windows.Forms.DataGridView)その1 2006/12/20 1:13 なおこ(・∀・)

>> シャノンさん
DataGrid だと、どぼん!さんの↓コレでしょうか。
http://codezine.jp/a/article/aid/3.aspx

# re: DataGridView(System.Windows.Forms.DataGridView)その1 2006/12/20 6:52 επιστημη

なるほどー、わんくまの中さんは要チェックな柴なのかー

# DataGridView(System.Windows.Forms.DataGridView)その2 2006/12/20 12:51 主婦と.NETと犬のぶろぐ

DataGridView(System.Windows.Forms.DataGridView)その2

# re: DataGridView(System.Windows.Forms.DataGridView)その1 2006/12/20 12:54 なおこ(・∀・)

>> えぴさん
中さんはくまじゃなかったでしたっけ。。。?

# aiIDHDomVsh 2011/12/13 18:24 http://www.d4women.net/alesse.php

This article is for professionals..!

# ipymgGxdrxxXOFbR 2012/01/07 7:42 http://www.luckyvitamin.com/c-361-kava-kava

Can be also this issue because the truth can be achieved only in a dispute :D

# re: Internet Explorer 11 で、右クリックしたときに表示されるメニューで、Bingではなく、Google をデフォルトの検索エンジンとして設定するには? 2017/12/08 18:12 meadc

http://www.nfl-shop.co nfl store
http://www.nike-chaussures.fr/ Air Max TN Homme
http://www.culinar-hannover.de/ Nike Air Force
http://www.pradahandbags.co prada handbags
http://www.burberry-outletsale.us/ burberry outlet sale store
me adc12.8

# Hmm is anyone else experiencing problems with the images on this blog loading? I'm trying to determine if its a problem on my end or if it's the blog. Any feedback would be greatly appreciated. 2019/09/25 6:04 Hmm is anyone else experiencing problems with the

Hmm is anyone else experiencing problems with the images on this
blog loading? I'm trying to determine if its a problem on my end or if it's the
blog. Any feedback would be greatly appreciated.

# Hmm is anyone else experiencing problems with the images on this blog loading? I'm trying to determine if its a problem on my end or if it's the blog. Any feedback would be greatly appreciated. 2019/09/25 6:05 Hmm is anyone else experiencing problems with the

Hmm is anyone else experiencing problems with the images on this
blog loading? I'm trying to determine if its a problem on my end or if it's the
blog. Any feedback would be greatly appreciated.

# Hmm is anyone else experiencing problems with the images on this blog loading? I'm trying to determine if its a problem on my end or if it's the blog. Any feedback would be greatly appreciated. 2019/09/25 6:06 Hmm is anyone else experiencing problems with the

Hmm is anyone else experiencing problems with the images on this
blog loading? I'm trying to determine if its a problem on my end or if it's the
blog. Any feedback would be greatly appreciated.

# Hmm is anyone else experiencing problems with the images on this blog loading? I'm trying to determine if its a problem on my end or if it's the blog. Any feedback would be greatly appreciated. 2019/09/25 6:07 Hmm is anyone else experiencing problems with the

Hmm is anyone else experiencing problems with the images on this
blog loading? I'm trying to determine if its a problem on my end or if it's the
blog. Any feedback would be greatly appreciated.

# Thanks for sharing your thoughts. I truly appreciate your efforts and I am waiting for your next write ups thanks once again. 2019/10/18 16:20 Thanks for sharing your thoughts. I truly apprecia

Thanks for sharing your thoughts. I truly appreciate your efforts and I am waiting for your next write ups
thanks once again.

# Thanks for the good writeup. It in truth was once a entertainment account it. Glance advanced to more added agreeable from you! By the way, how could we communicate? 2019/11/04 18:32 Thanks for the good writeup. It in truth was once

Thanks for the good writeup. It in truth was once a entertainment account it.

Glance advanced to more added agreeable from you! By the way, how could we communicate?

# I've learn several good stuff here. Certainly worth bookmarking for revisiting. I surprise how so much attempt you set to make any such magnificent informative website. 2019/11/14 8:46 I've learn several good stuff here. Certainly wort

I've learn several good stuff here. Certainly worth bookmarking for revisiting.
I surprise how so much attempt you set to make any
such magnificent informative website.

# Good day! I could have sworn I've been to this site before but after browsing through a few of the articles I realized it's new to me. Regardless, I'm certainly pleased I stumbled upon it and I'll be book-marking it and checking back regularly! 2019/11/29 6:12 Good day! I could have sworn I've been to this sit

Good day! I could have sworn I've been to this site before
but after browsing through a few of the articles I realized it's new to me.
Regardless, I'm certainly pleased I stumbled upon it and I'll
be book-marking it and checking back regularly!

# Good day! I could have sworn I've been to this site before but after browsing through a few of the articles I realized it's new to me. Regardless, I'm certainly pleased I stumbled upon it and I'll be book-marking it and checking back regularly! 2019/11/29 6:15 Good day! I could have sworn I've been to this sit

Good day! I could have sworn I've been to this site before
but after browsing through a few of the articles I realized it's new to me.
Regardless, I'm certainly pleased I stumbled upon it and I'll
be book-marking it and checking back regularly!

# Good day! I could have sworn I've been to this site before but after browsing through a few of the articles I realized it's new to me. Regardless, I'm certainly pleased I stumbled upon it and I'll be book-marking it and checking back regularly! 2019/11/29 6:17 Good day! I could have sworn I've been to this sit

Good day! I could have sworn I've been to this site before
but after browsing through a few of the articles I realized it's new to me.
Regardless, I'm certainly pleased I stumbled upon it and I'll
be book-marking it and checking back regularly!

# Good day! I could have sworn I've been to this site before but after browsing through a few of the articles I realized it's new to me. Regardless, I'm certainly pleased I stumbled upon it and I'll be book-marking it and checking back regularly! 2019/11/29 6:19 Good day! I could have sworn I've been to this sit

Good day! I could have sworn I've been to this site before
but after browsing through a few of the articles I realized it's new to me.
Regardless, I'm certainly pleased I stumbled upon it and I'll
be book-marking it and checking back regularly!

# No matter if some one searches for his vital thing, therefore he/she desires to be available that in detail, thus that thing is maintained over here. 2019/12/04 8:50 No matter if some one searches for his vital thing

No matter if some one searches for his vital thing, therefore he/she desires to be available that in detail, thus
that thing is maintained over here.

# What's up, the whole thing is going perfectly here and ofcourse every one is sharing information, that's in fact good, keep up writing. 2019/12/07 10:31 What's up, the whole thing is going perfectly here

What's up, the whole thing is going perfectly here and ofcourse every one is sharing information, that's in fact good, keep
up writing.

# Excellent post. I will be experiencing many of these issues as well.. 2019/12/13 10:15 Excellent post. I will be experiencing many of th

Excellent post. I will be experiencing many of these issues as well..

# 1 Studies show that The narrow statistical 7 2020/01/01 4:24 Typicalcat43

http://madcom.ro/%ef%bb%bfmost-effective-senior-dating-online-sites/ no fee best rated senior dating online site https://www.midhealth.ca/50s-and-older-seniors-dating-online-website-blogs.wankuma.com.pdf looking for older wealthy seniors in kansas https://litsiou-eleni.gr/%ef%bb%bfmost-visited-mature-dating-online-site-full-free/ 50's plus seniors dating online site no pay http://www.mundoposibilidades.com/free-to-contact-mature-online-dating-service-blogs.wankuma.com.pdf utah christian mature dating online service

# Oh my goodness! Amazing article dude! Thanks, However I am having issues with your RSS. I don't know why I can't join it. Is there anyone else getting similar RSS issues? Anyone that knows the answer will you kindly respond? Thanx!! 2020/01/03 12:18 Oh my goodness! Amazing article dude! Thanks, Howe

Oh my goodness! Amazing article dude! Thanks, However I
am having issues with your RSS. I don't know why I can't join it.
Is there anyone else getting similar RSS issues?

Anyone that knows the answer will you kindly respond? Thanx!!

# Oh my goodness! Amazing article dude! Thanks, However I am having issues with your RSS. I don't know why I can't join it. Is there anyone else getting similar RSS issues? Anyone that knows the answer will you kindly respond? Thanx!! 2020/01/03 12:19 Oh my goodness! Amazing article dude! Thanks, Howe

Oh my goodness! Amazing article dude! Thanks, However I
am having issues with your RSS. I don't know why I can't join it.
Is there anyone else getting similar RSS issues?

Anyone that knows the answer will you kindly respond? Thanx!!

# Oh my goodness! Amazing article dude! Thanks, However I am having issues with your RSS. I don't know why I can't join it. Is there anyone else getting similar RSS issues? Anyone that knows the answer will you kindly respond? Thanx!! 2020/01/03 12:20 Oh my goodness! Amazing article dude! Thanks, Howe

Oh my goodness! Amazing article dude! Thanks, However I
am having issues with your RSS. I don't know why I can't join it.
Is there anyone else getting similar RSS issues?

Anyone that knows the answer will you kindly respond? Thanx!!

# Oh my goodness! Amazing article dude! Thanks, However I am having issues with your RSS. I don't know why I can't join it. Is there anyone else getting similar RSS issues? Anyone that knows the answer will you kindly respond? Thanx!! 2020/01/03 12:21 Oh my goodness! Amazing article dude! Thanks, Howe

Oh my goodness! Amazing article dude! Thanks, However I
am having issues with your RSS. I don't know why I can't join it.
Is there anyone else getting similar RSS issues?

Anyone that knows the answer will you kindly respond? Thanx!!

# I am regular visitor, how are you everybody? This post posted at this website is truly good. 2020/01/08 21:07 I am regular visitor, how are you everybody? This

I am regular visitor, how are you everybody? This post posted at this website
is truly good.

# I am regular visitor, how are you everybody? This post posted at this website is truly good. 2020/01/08 21:08 I am regular visitor, how are you everybody? This

I am regular visitor, how are you everybody? This post posted at this website
is truly good.

# I am regular visitor, how are you everybody? This post posted at this website is truly good. 2020/01/08 21:08 I am regular visitor, how are you everybody? This

I am regular visitor, how are you everybody? This post posted at this website
is truly good.

# I am regular visitor, how are you everybody? This post posted at this website is truly good. 2020/01/08 21:09 I am regular visitor, how are you everybody? This

I am regular visitor, how are you everybody? This post posted at this website
is truly good.

# My brother suggested I might like this web site. He was entirely right. This post actually made my day. You can not imagine just how much time I had spent for this information! Thanks! 2020/01/14 18:07 My brother suggested I might like this web site.

My brother suggested I might like this web site. He was entirely right.
This post actually made my day. You can not imagine just how much time I had spent for this
information! Thanks!

# No matter if some one searches for his essential thing, so he/she wants to be available that in detail, so that thing is maintained over here. 2020/01/15 22:08 No matter if some one searches for his essential t

No matter if some one searches for his essential thing, so he/she wants to be available
that in detail, so that thing is maintained over here.

# Hurrah, that's what I was seeking for, what a data! present here at this webpage, thanks admin of this site. 2020/02/01 5:29 Hurrah, that's what I was seeking for, what a data

Hurrah, that's what I was seeking for, what a data!
present here at this webpage, thanks admin of this site.

# Hurrah, that's what I was seeking for, what a data! present here at this webpage, thanks admin of this site. 2020/02/01 5:29 Hurrah, that's what I was seeking for, what a data

Hurrah, that's what I was seeking for, what a data!
present here at this webpage, thanks admin of this site.

# Hurrah, that's what I was seeking for, what a data! present here at this webpage, thanks admin of this site. 2020/02/01 5:30 Hurrah, that's what I was seeking for, what a data

Hurrah, that's what I was seeking for, what a data!
present here at this webpage, thanks admin of this site.

# Good day! I could have sworn I've been to this blog before but after checking through some of the post I realized it's new to me. Anyhow, I'm definitely happy I found it and I'll be bookmarking and checking back frequently! 2020/02/03 20:49 Good day! I could have sworn I've been to this blo

Good day! I could have sworn I've been to this blog before but after checking through
some of the post I realized it's new to me. Anyhow, I'm definitely happy I found it and
I'll be bookmarking and checking back frequently!

# Good day! I could have sworn I've been to this blog before but after checking through some of the post I realized it's new to me. Anyhow, I'm definitely happy I found it and I'll be bookmarking and checking back frequently! 2020/02/03 20:50 Good day! I could have sworn I've been to this blo

Good day! I could have sworn I've been to this blog before but after checking through
some of the post I realized it's new to me. Anyhow, I'm definitely happy I found it and
I'll be bookmarking and checking back frequently!

# Good day! I could have sworn I've been to this blog before but after checking through some of the post I realized it's new to me. Anyhow, I'm definitely happy I found it and I'll be bookmarking and checking back frequently! 2020/02/03 20:50 Good day! I could have sworn I've been to this blo

Good day! I could have sworn I've been to this blog before but after checking through
some of the post I realized it's new to me. Anyhow, I'm definitely happy I found it and
I'll be bookmarking and checking back frequently!

# Ahaa, its good conversation on the topic of this article here at this blog, I have read all that, so now me also commenting here. 2020/02/27 8:09 Ahaa, its good conversation on the topic of this a

Ahaa, its good conversation on the topic of this
article here at this blog, I have read all that, so now me also commenting here.

# Amazing! Its really amazing paragraph, I have got much clear idea about from this article. 2020/02/28 1:43 Amazing! Its really amazing paragraph, I have got

Amazing! Its really amazing paragraph, I have got much clear idea about from this article.

# These are in fact great ideas in about blogging. You have touched some good things here. Any way keep up wrinting. 2020/03/23 6:56 These are in fact great ideas in about blogging. Y

These are in fact great ideas in about blogging. You have touched some good things here.
Any way keep up wrinting.

# Wonderful, what a web site it is! This weblog presents valuable information to us, keep it up. 2020/03/25 8:29 Wonderful, what a web site it is! This weblog pres

Wonderful, what a web site it is! This weblog presents valuable information to us, keep
it up.

# UFA600S แทงบอลออนไลน์ เว็บแทงบอล บอลเต็ป บอลเต็ง ไม่มีอย่างน้อย 2020/04/10 8:29 UFA600S แทงบอลออนไลน์ เว็บแทงบอล บอลเต็ป บอลเต็ง

UFA600S ????????????? ?????????? ??????? ??????? ??????????????

# Pretty! This has been an incredibly wonderful post. Many thanks for providing this information. 2020/05/02 1:28 Pretty! This has been an incredibly wonderful post

Pretty! This has been an incredibly wonderful post. Many thanks for providing this
information.

# This piece of writing provides clear idea designed for the new viewers of blogging, that actually how to do running a blog. 2020/05/11 8:21 This piece of writing provides clear idea designed

This piece of writing provides clear idea designed for the new viewers of blogging, that actually how to
do running a blog.

# https://prevention.nd.gov/files/filefield_paths/fortnite%20free%20v%20bucks%20hack.pdf https://prevention.nd.gov/files/filefield_paths/fortnite%20free%20v%20bucks%20hack.pdf https://prevention.nd.gov/files/filefield_paths/fortnite%20free%20v%20bucks%20hac 2020/05/29 10:47 https://prevention.nd.gov/files/filefield_paths/fo

https://prevention.nd.gov/files/filefield_paths/fortnite%20free%20v%20bucks%20hack.pdf
https://prevention.nd.gov/files/filefield_paths/fortnite%20free%20v%20bucks%20hack.pdf
https://prevention.nd.gov/files/filefield_paths/fortnite%20free%20v%20bucks%20hack.pdf
https://prevention.nd.gov/files/filefield_paths/fortnite%20free%20v%20bucks%20hack.pdf

タイトル  
名前  
Url
コメント