private QGroupBox InitQLineEdit() { QGroupBox groupBox = new QGroupBox("QLineEdit", this); QVBoxLayout vBox = new QVBoxLayout(); QLabel label = new QLabel("Change the text in Line Edit", this); QLineEdit lineEdit = new QLineEdit(this); lineEdit.TextChanged += (string txt) => { label.Text = txt; label.AdjustSize(); }; vBox.AddWidget(lineEdit); vBox.AddWidget(label); groupBox.Layout = vBox; return(groupBox); }
//public ComboBoxDemo() //{ // WindowTitle = "ComboBox Demo"; // InitUI(); // Resize(250, 200); // Move(100, 100); // Show(); //} public override void InitUI() { var layout = new QVBoxLayout(this); label = new QLabel("Selected"); label.AdjustSize(); layout.AddWidget(label); var combo = new QComboBox(this); combo.AddItem("Ubuntu"); combo.AddItem("Arch"); combo.AddItem("Fedora"); combo.AddItem("Red Hat"); combo.AddItem("Gentoo"); layout.AddWidget(combo); combo.ActivatedText += OnActivated; }
public void OnChanged(string text) { label.Text = text; label.AdjustSize(); }
private QGroupBox InitQLineEdit() { QGroupBox groupBox = new QGroupBox ("QLineEdit", this); QVBoxLayout vBox = new QVBoxLayout (); QLabel label = new QLabel ("Change the text in Line Edit", this); QLineEdit lineEdit = new QLineEdit (this); lineEdit.TextChanged += (string txt) => { label.Text = txt; label.AdjustSize(); }; vBox.AddWidget (lineEdit); vBox.AddWidget (label); groupBox.Layout = vBox; return groupBox; }
public void OnActivated(string text) { label.Text = $"Selected text: {text}"; label.AdjustSize(); }