How can I add moving effects to my controls in C#?

Window animation is a built-in feature for Windows. Here’s a class that uses it: using System; using System.ComponentModel; using System.Windows.Forms; using System.Runtime.InteropServices; public static class Util { public enum Effect { Roll, Slide, Center, Blend } public static void Animate(Control ctl, Effect effect, int msec, int angle) { int flags = effmap[(int)effect]; if (ctl.Visible) { … Read more

GroupBox / TitledBorder in JavaFX 2?

No such standard control, but it it is easy to create your own. Here is a sample implementation: /** Places content in a bordered pane with a title. */ class BorderedTitledPane extends StackPane { BorderedTitledPane(String titleString, Node content) { Label title = new Label(” ” + titleString + ” “); title.getStyleClass().add(“bordered-titled-title”); StackPane.setAlignment(title, Pos.TOP_CENTER); StackPane contentPane … Read more

Loop through all controls of a Form, even those in GroupBoxes

The Controls collection of Forms and container controls contains only the immediate children. In order to get all the controls, you need to traverse the controls tree and to apply this operation recursively private void AddTextChangedHandler(Control parent) { foreach (Control c in parent.Controls) { if (c.GetType() == typeof(TextBox)) { c.TextChanged += new EventHandler(C_TextChanged); } else … Read more

tech