I'm working on a personal project, and I want to create a simple GUI to accomplish this project.(Using C#) My main goal for this project is the creation of a custom grid of squares. What I would like is for the user to be able to click any of the generated squares on the GUI, and be able to change the color of that square. Now, I've looked for the past few nights but I haven't had any luck with finding anything to fit that sort of request.
Would it be easier for me to create square button controls ahead of time and just hide the ones I don't use? Or is it at all possible to dynamically create buttons in a grid shape? Or is there something more efficient than using buttons that can change color?
Thank you for any help!
EDIT: I'm planning on using Winforms, and I was going to build this GUI using a desktop application.
Related
At the moment I have no Idea how to start this. I created a blank UserControl in WPF. My Window looks like this at the moment:
The List on the right is a ListView. I want to Drag and Drop an Item of the List (Not the topic, asking that in another question soon). When i drop it on the white space, I want the Image to get drawn where I dropped it.
But I don't want it only to be an Image, in general, this Program is for creating a setup by drag and dropping the Modules on the right and create a configuration with the setup you've built in the big plain space. This image may make that more clear:
These Images need to be able to rearranged at any time, so I don't think I just need to draw them, I need to place an Object on the Work-place. Imagine it like Windows Forms, where you drag and drop your tools, rearrange them and be able to zoom in and out. I don't need the Zoom feature yet, but it's going to be in there too. Is there maybe a nuget that I can use for implementing a "Drawing-Board"?
As a learning project in C# .net I am re-creating a Gnome 3 plugin for seeing who of the streamers you follow on Twitch is live. I have the settings form done, I am now working on the interface that is viewed from a click on the taskbar.
This is a rough image of what I want the interface to look like. When two or more streamers are live the interface would add another block and resize the form vertically similar to the menu for selecting a Wifi network in Windows.
What would be the best way for me to complete this?
My current thought is to maybe create a custom control and just place those inside a FlowLayoutPanel with some kind of code to change the vertical size of the form to match the added entries. Maybe this can be done without a custom control and be done with code inside a FlowLayoutPanel? I'm not too sure.
Ideally I would also have a click event in the panel for each streamer so I could then open a browser to their channel. A slight highlight would also be a plus (maybe change the background colour based on mouse hover).
Thanks in advance for any suggestions!
I've decided to took up a evening time project. I decided to write a simple GUI application displaying info about units form some game.
I've poked around and decided to do it in a C# WPF application. I have a background in java and C, so programming isn't that different.
I want to add some eye candy to it by having a series of images cropped to half one under another. And when one gets a mouse click I want to show it whole. (ie accordion behaviour), if some picture is already fullsize I want to collapse it.
I was thinking about couple of solutions, but since its my first C# project I thought it best to ask for the best/easiest solution.
Check out this Customizing WPF Expander with ControlTemplate article over on codeproject.com...
I think the WPF Expander control is what you are looking for. You can use a StackPanel to create a series of them.
EDIT:
So, I ended up making my own basic solution to this problem, and it can be found in my own answer to the question below. Or, here's a link.
Original Post
I'm doing some UI programming for a small .NET application. The application has some collections of items that need to be displayed in a grid sort of format (X columns by Y rows) and the grid elements need to be able to get dragged around to different grid locations, and possibly out of the grid all together.
The most comparable sort of UI design elements I can think of are the jQueryUI Draggables.
Do I have to roll my own or are there components people have already written to act like this? Even better, are there any free components? Or is there an easy way to do this that I just don't know about (don't do a lot of .NET UI programming..)
Also these "grid items" need to be able to include windows form components. The DataRepeater control is close to what I need, except it only supports horizontal or vertical alignments, not grids of items.
Here's a visual example of what I'm looking for:
I tried to stick with a halloween theme here.
Well I rolled my own solution and hosted it on GoogleCode:
draggableitemorderedpanel- A .NET Winforms Component... Kinda like jQuery UI Draggables (not really, maybe someday)
here's a screenshot:
(source: googlecode.com)
and another just resized:
(source: googlecode.com)
Hope this helps someone else out. Also it's super basic and pretty sucks right now but gets the job done.
Anyone that wants project access can have it.
The System.Windows.Forms.TableLayoutPanel control supports dragging and dropping, you just have to handle the right events. You could make your own "GridItem" user control, with the icon, caption, background color, etc displayed on a Panel, and then plop a bunch of them in the tablelayoutpanel, and wire up some event handlers. Here's something similar:
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/1cade626-b76d-40c5-9e5a-101cf2a5e412
I am trying to create a panel which will have a set of "buttons" on it.
These buttons should have the following behaviour:
Appear similar to a tag (with
rounded edges)
Contain a red
cross to remove the filter/tag from
the panel, similar to the way internet
explorer tabs have an embedded cross to close the individual tab.
allow the user to click
on the tag and respond like a normal
button (as long as the click is not
in the red cross)
Number 1 is no problem, this is just appearance, however, regarding numbers 2 and 3, I am not sure if there is already code out there do to something similar...and I dont really want to reinvent the wheel if I can avoid it!
My question is: Does anyone know if there is something out there in infragistics which will do this simply, or will I need to write this myself by subclassing winform buttons?
Thanks in advance!
Is this new development or maintenance of an existing project?
If it is maintenance, you have a somewhat tougher time ahead. You'll implement a UserControl, probably segmented into two buttons. Use docking to get the behavior as correct as possible. The far right button would contain your cross image; the left (which would need to auto-expand as you resize the control) would contain your primary button behavior. Play with the visual styles until you get them right (EG, removing borders, etc).
If this is new development, and you haven't gotten too far into it, you might consider using Windows Presentation Framework (WPF) instead of WinForms. It will be easier to build the control and get it to look exactly how you want it. WPF includes an extremely powerful control compositing system which allows you to layer multiple controls on top of each other and have them work exactly as you'd expect, and it carries the added advantage of allowing full visual control out-of-the-box.
Either way, this is more work than dropping in an external component ... I've used Infragistics for years, and I can't think of anything they have which is comparable. The closest, but only if you're building an MDI application and these controls are for window navigation, is the Tabbed MDI window management tools -- and there, only the tabs (which replace window title bars) have this behavior.
I don't think that infragistics can do something like this. The UltraButton control can't.
Implementing a own control wouldn't be that hard.
your probably going to have to make a costume control for this type of work.