![]() |
|
[.NET] [VB/C#] Matrix Fall | GDI+ Matrix-Grid-ish Control - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] [VB/C#] Matrix Fall | GDI+ Matrix-Grid-ish Control (/showthread.php?tid=4875179) Pages: Pages
1
2
|
* - Hawk HF - Jun 24, 2015 I feel like this thread, along with other GDI threads, isn't getting the attention it deserves. Maybe it's just me, but I think things like this are really cool. * - Oliver Sykes - Jun 24, 2015 Odus, trvp did this with numbers as well. Maybe add that? * - +Haze - Jun 24, 2015 Odus is my son, I think I deserve a shoutout too! * - SubGenius - Jun 26, 2015 Filthy GDI peasants still using timers and .FillRectangle WPF master race Lelelelelelele * - Hawk HF - Jun 26, 2015 (Jun 26, 2015 01:58 PM)SubGenius Wrote: Filthy GDI peasants still using timers and .FillRectangle There was a time a while ago where I made a thread to take requests for GDI controls. https://hackforums.net/showthread.php?tid=3930319&pid=36989738#pid36989738 ![]() Let's not get cocky. ;) * - SubGenius - Jun 26, 2015 (Jun 26, 2015 02:14 PM)Hawk HF Wrote: There was a time a while ago where I made a thread to take requests for GDI controls. 🤫 Hey, that was like 1.5 years ago... * - iLogic™ - Jun 27, 2015 Great release man 🙂 Nice looking 😉 * - AustinPape10101 - Jun 28, 2015 Stupid question but with your example. How would we go about using a combobox to change the color and also change the size of the objects? * - Odus - Jun 29, 2015 (Jun 24, 2015 07:20 PM)Oliver Sykes Wrote: Odus, trvp did this with numbers as well. Maybe add that? I was actually going to 1up him and allow a custom array of characters, will update OP shortly. (Jun 28, 2015 06:53 PM)AustinPape10101 Wrote: Stupid question but with your example. How would we go about using a combobox to change the color and also change the size of the objects? Not at all. The Colors property is of type color array, so you can change the colors using that. In the demonstration, I used a Dictionary of String & Color() to hold my colors and set the ComboBox's data source to the dictionary. So the keys (string) front the ComboBox items but the value is really your colors (color()). Like so: Code Dim cd As New Dictionary(Of String, Color()) From {When using, I just cast the selected item to a KeyValuePair and set the Colors property to its value: Code MatrixFall1.Colors = DirectCast(ComboBox1.SelectedItem, KeyValuePair(Of String, Color())).ValueFor the objects' size, use the BlockSize property which is of type Size. So in your NumericUpDown ValueChanged event, set the BlockSize to their values: Code MatrixFall1.BlockSize = New Size(Convert.ToInt32(NumericUpDown1.Value), Convert.ToInt32(NumericUpDown2.Value))This was for a demo so I didn't bother changing the control names. I'm glad so many people like it though! |