OT Datagrid v Tabpage - VB VS2013
Pavel Urbancik
hw na itherm.cz
Úterý Srpen 12 11:22:19 CEST 2014
Je to System.Windows.Forms a mam pouzity DataGridView
Udelal jsem v podstate jen form, vlozil tab co ma 4 zalozky.
Do 2. Zalozky vlozil datagridview a textbox.
Vse nechal v default a jen okopiroval kod z helpu na naplneni
Kod je pod textem.
Kdyz je datagridview na prvni zalozce, nebo primo ve formu, tak to chodi,
tzn program vlozi radky a vidim je.
Kdyz je datagrid na druhe zalozce, tak vidim jen jeden radek a klikanim se
ukazuje jen vybrany.
Pavel
Private Sub TextBox1_Click(sender As Object, e As EventArgs) Handles
TextBox1.Click
DataGridView2.ColumnCount = 5
With DataGridView2.ColumnHeadersDefaultCellStyle
.BackColor = Color.Navy
.ForeColor = Color.White
.Font = New Font(DataGridView2.Font, FontStyle.Bold)
End With
With DataGridView2
.Name = "DataGridView2"
.AutoSizeRowsMode = _
DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders
.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single
.CellBorderStyle = DataGridViewCellBorderStyle.Single
.GridColor = Color.Black
.RowHeadersVisible = False
.Columns(0).Name = "Release Date"
.Columns(1).Name = "Track"
.Columns(2).Name = "Title"
.Columns(3).Name = "Artist"
.Columns(4).Name = "Album"
.Columns(4).DefaultCellStyle.Font = _
New Font(Me.DataGridView2.DefaultCellStyle.Font,
FontStyle.Italic)
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
.MultiSelect = False
End With
Dim row0 As String() = {"11/22/1968", "29", "Revolution 9", _
"Beatles", "The Beatles [White Album]"}
Dim row1 As String() = {"1960", "6", "Fools Rush In", _
"Frank Sinatra", "Nice 'N' Easy"}
Dim row2 As String() = {"11/11/1971", "1", "One of These Days", _
"Pink Floyd", "Meddle"}
Dim row3 As String() = {"1988", "7", "Where Is My Mind?", _
"Pixies", "Surfer Rosa"}
Dim row4 As String() = {"5/1981", "9", "Can't Find My Mind", _
"Cramps", "Psychedelic Jungle"}
Dim row5 As String() = {"6/10/2003", "13", _
"Scatterbrain. (As Dead As Leaves.)", _
"Radiohead", "Hail to the Thief"}
Dim row6 As String() = {"6/30/1992", "3", "Dress", "P J Harvey",
"Dry"}
With Me.DataGridView2.Rows
.Add(row0)
.Add(row1)
.Add(row2)
.Add(row3)
.Add(row4)
.Add(row5)
.Add(row6)
End With
End Sub
-----Original Message-----
From: Hw-list [mailto:hw-list-bounces na list.hw.cz] On Behalf Of Jirí Nesvacil
Sent: 12. srpna 2014 10:08
To: hw-list na list.hw.cz
Subject: Re: OT Datagrid v Tabpage - VB VS2013
Zdravim,
to nejspis zapasite s WPF a layouts. Neboli WPF si zjistuje jak jsou
potrebne velke controly a podle toho udela velikost okna, tabu, ... . Pokud
zvetsite okno, tak se vam zobrazi vse ? Zkuste to dat do layoutu napr Grid v
designeru.
Nebo budete muset nejprve naplnit datagrid a nasledne zobrazit ci urcit
pevne sirky sloupcu datagridu.
Jirka
Dne 11. 8. 2014 23:07, Pavel Urbancik napsal(a):
> Zdravim konferu,
>
> Mam prosbu o radu od mistnich programatoru ve Visual studiu.
> Delam malinkou aplikaci a rad bych pouzil tabpage (nevim jak se to
> jmenuje
> cesky)
>
> Kdyz dam na druhy tab datagrid, tak se mi spatne zobrazuje jeho obsah
> (je videt jen vybrana bunka) Kdyz ji dam primo na form, nebo na prvni
> tab, tak to chodi v pohode.
>
> Nesetkal se nekdo s takovym problemem.
>
> Pavel
>
>
>
>
> _______________________________________________
> HW-list mailing list - sponsored by www.HW.cz Hw-list na list.hw.cz
> http://list.hw.cz/mailman/listinfo/hw-list
_______________________________________________
HW-list mailing list - sponsored by www.HW.cz Hw-list na list.hw.cz
http://list.hw.cz/mailman/listinfo/hw-list
Další informace o konferenci Hw-list