Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15778

VS 2017 [HELP ME] resize pictures streched in datagribview![for beginner]

$
0
0
Hello everybody!
i have light problem! i have a datagribview with this code:



For Each DataGridViewImageColumn In Form1.DataGridView2.Columns

DataGridViewImageColumn.ImageLayout = DataGridViewImageCellLayout.Stretch


Next


Form1.DataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
Form1.DataGridView2.RowTemplate.Height = 70
Dim newItems() As String = Form1.ListBox2.Items.Cast(Of String).Select(Function(s) s.Split(" "c).Last & " " & s.Split(" "c).Last).ToArray
Dim newItemsA() As String = Form1.ListBox2.Items.Cast(Of String).Select(Function(s) s.Split(" "c).Last & " " & s.Split(" "c).First).ToArray
Form1.DataGridView2.DataSource = Enumerable.Range(1, newItems.Length).
Select(Function(n) New With {.Rank = n, .Image = Image.FromFile(Application.StartupPath & "\DANfiles\challengersgif" & newItems(n - 1).Substring(newItems(n - 1).IndexOf(" ") + 1) & ".png"), .Name = newItemsA(n - 1)}).
ToArray()



but the second column with pictures are not resized or no streched. i would like a piece of coding in order to the pictures be resized or same size streched.


thank you in advance for your answers and help!
sorry for my english, i am from france and started coding.:)

Viewing all articles
Browse latest Browse all 15778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>