I need a control in my C# program that behaves exactly the same as MS Expression Blend keyspline control - is there any way to get hold of that control and add it to my application?
As a side note it'd be nice to use some of the other controls that appear in that applications as well
What do you mean by add it to your application? If you're developing a C# WPF application you can already add it using the Blend designer or programatically in Visual Studio.
You can inherit from all the WPF controls to create new ones that enhance the behaviour if needed. If you simply want to customise the feel of a control you can use styles within Expression Blend. If you want to customise the complete look, feel and behaviour of a control you also have the option of templates.
Ok sorry for uing the wrong terminology.
I want to add the control into Visual Studio 2005's toolbox (or indeed Expression Blend's Asset Library) so that I can drag and drop it into any C# WPF applications I create.
The problem is I don't know what the Expression Blend Keyspline control is called and how to get access to it (ie what dll to include as a reference)?
I can try and go through Expression Blend's dll's etc searching for the control but I'm not sure A) that this will work, B) that its a bit long winded, C) what the licensing is for such controls.
I think what you want to do is add a Storyboard, that's where you will then have the option to set the animations including KeySplines for your different controls. A KeySpline by itself is not actually a control it is an animation that acts on a control.
To add a Storyboard click the little plus icon at the top of the "Objects and Timeline" panel (to the right of where is says No Storyboard Open).
Related
I am doing my first steps programming a little toolbox in C#.
I want to choose the program to run via a menustrip.
How can I switch all visible textboxes, buttons etc. on the same form? I don't want to open a new form. Do I have to show/hide every element "by hand" or is there a better solution?
I hope you get my problem.
Thanks in advance.
Yes totally understood.
You need a way to navigate between different fragments within your application.
Since these are your first steps and not a legacy app, why aren't you starting with WPF which is the successor of Winforms ? (newer better)
See how can you achieve such functionally in WPF
https://learn.microsoft.com/en-us/dotnet/desktop/wpf/app-development/navigation-overview?view=netframeworkdesktop-4.8
Although the terms are similar and also apply in winforms.
What you want to do is to create all the buttons etc as part of a UserControl. You can then add your custom UserControl to the form. This should allow you to switch the user control for some other control, or change the visibility for the whole user control.
This can also allow you to place multiple user controls side by side or in some other layout.
I am currently in the process of improving my options dialog for a winforms application. At the moment I am using a tab control.
I would like to create a form/dialog for settings that is similar to Visual Studio's. How is this done? I can see a treeview like control on the left hand side but what control are they using to display each of the options pages, it doesn't appear to be a tab control. I would like to be able to build the controls for each of the settings at design time.
Thanks.
They look to me like UserControls. I can't say how exactly they implement it, but it would be simple enough to build a UserControl for each option type and swap out the current control when the tree view selection changes. In your designer you would simply have the TreeView and a parent panel to host the UserControls. At runtime you would perform the swap.
I would like to create a GUI where the main panel expands him self only to the space available, and then if some of the tools 1 or 2 are activated they appear at the top right side and if other tool is started it would automatically displays below ht visible ones or at top of none is displayed...
And if possible the append function.
I think its possible to do this with a bunch of if statements to re-size the panels everytime something would change the window content but there must be an easy way to do this.
Is something similar to the workflow of visual Studio...
Right now im using Windows Forms but i think its possible to switch to WPF
So what I'm looking for is for tutorials,sites,guides or simple a call to pay attention to some options inside the visual studio himself to help me create what I'm trying to achieve.
Here is a mock up to a better understanding
http://i.stack.imgur.com/0vupi.jpg
P.S the only thing I managed to do is hide and make visible the tool panels, but the space is always occupied in blank, and they appear no at top or bottom but the place where i drop them even if i dock them.
If you're open to third party controls, Telerik makes a fantastic dock control that does exactly what you're looking for.
Another option would be Digital Rune Docking or Windows, which is free for non-commercial use.
For a OSS project, I'm trying to add controls programmatically to a WinForms view.. and I want to make these editable and resizeable as in the Visual Studio Designer. I've been playing around with adding programmatically, using Controls.Add(label).. but I'm struggling to work out how to make the UI editable.
I'm assuming it would make use of DesignMode - but I can only find getters and not setters for these properties. Simply put - is there any way of enabling and disabling DesignMode in WinForms programmatically?
I'm yet to investigate WPF - perhaps that would be able to have editable controls?
Many thanks, sorry to be a pain right after christmas..
T
Actually there is a way to make UI editable as in VS designer.You have to host the winforms designer on your form.
this info might help:
http://msdn.microsoft.com/en-us/magazine/cc163634.aspx
It is available in WinForm as explained by alexm. Unfortunately this is not true for the WPF designer. There you would have to implement your own designer.
As far as I know, the Designer functionality is implemented in Visual Studio, and is not part of the WinForms runtime libraries. The DesignMode property is read-only because it gives information about the execution context; this is not something that can be changed on the fly (as a side note: this property is not as easy to use as one would hope).
If you want to make the UI editable at runtime (i.e. changing the size/layout of controls), you would have to implement a lot of the behavior manually (e.g. OnMouseDown handlers, etc.). If you wanted to do things like drawing bounding boxes with grabbable corners, you might need to delve into custom drawing.
I'm not sure about WPF, as I have much less experience with it, but this question on SO has some information about making controls resizable at runtime.
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.