Настройки пока:
[*] У меня есть wpf grid с текстовым автоматом SET в COL и ROW.
Существует набор enum для выбора элементов. /> < /ul>
Примечания: < /p>
Ninjatrader больше не использует формы и теперь использует wpf. < /li>
Я не хочу интерфейс Web /XML или HTML. Just C# используется в сетке. src = "https://i.sstatic.net/v0u32h2t.png"/>
Пример кода:
#region Enums
namespace Profit_Bot_Enums
{
public enum MySystems
{
[Display(Name = "NotSet")]
NotSet = 0,
[Display(Name = "PrevBarHbuy")]
PrevBarHbuy = 1,
[Display(Name = "OldSystem")]
OldSystem = 2
};
}
#endregion
#region System-r3
this.SystemLabel = new Label
{
Content = string.Format("System Strategy: ", 0),
Height = 20.0,
Margin = new Thickness(4.0, 0.0, 4.0, 0.0),
Padding = new Thickness(0.0, 2.0, 0.0, 2.0),
HorizontalAlignment = HorizontalAlignment.Center
};
this.SystemLabel.Foreground = Brushes.White;
this.SystemLabel.Background = Brushes.Transparent;
this.SystemLabel.BorderBrush = Brushes.Transparent;
this.SystemLabel.HorizontalAlignment = HorizontalAlignment.Center;
Grid.SetColumnSpan(this.SystemLabel, 1);
Grid.SetRow(this.SystemLabel, 3);
grid5.Children.Add(this.SystemLabel);
string formatSys = string.Empty;
#endregion
#region button-r3_text
this.systemsLabelVal = new TextBox
{
Text = string.Format(this.systemsValue.ToString(), 0),
Height = 20.0,
Width = 60.0,
FontSize = 10.0,
HorizontalAlignment = HorizontalAlignment.Center
};
this.systemsLabelVal.Foreground = Brushes.White;
this.systemsLabelVal.Background = Brushes.Transparent;
this.systemsLabelVal.BorderBrush = Brushes.Transparent;
this.systemsLabelVal.HorizontalAlignment = HorizontalAlignment.Right;
this.systemsLabelVal.VerticalAlignment = VerticalAlignment.Center;
this.systemsLabelVal.TextAlignment = TextAlignment.Center;
Grid.SetColumnSpan(this.systemsLabelVal, 3);
Grid.SetRow(this.systemsLabelVal, 3);
this.systemsLabelVal.PreviewKeyDown += this.TextBox_PreviewKeyDown;
grid5.Children.Add(this.systemsLabelVal);
#endregion
#region Systems button-r4
this.Systemsbtn = new Button
{
Content = string.Format("None", 1),
Name = "None",
Height = 30.0,
Margin = new Thickness(4.0, 4.0, 4.0, 0.0),
Padding = new Thickness(4.0, 0.0, 4.0, 0.0),
Style = style
};
this.Systemsbtn.Background = Brushes.Gray;
this.Systemsbtn.BorderBrush = Brushes.DimGray;
this.Systemsbtn.Foreground = Brushes.White;
this.Systemsbtn.Click += this.Systemsbtn_Click;
Grid.SetColumnSpan(this.Systemsbtn, 3);
Grid.SetRow(this.Systemsbtn, 4);
grid5.Children.Add(this.Systemsbtn);
#endregion
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
}
private void Systemsbtn_Click(object sender, RoutedEventArgs e)
{
}
< /code>
Спасибо за любые идеи о реализациях! < /p>
Я попытался установить значения enum в разных местах в коде. Мне еще предстоит найти правильный способ реализации.
Подробнее здесь: https://stackoverflow.com/questions/797 ... -c-with-wp
Ninjatrader Dropl Down Down, чтобы заполнить значение текстового поля или кнопки текстового значения (C# с доступным WPF ⇐ C#
Место общения программистов C#
1756047163
Anonymous
Настройки пока:
[*] У меня есть wpf grid с текстовым автоматом SET в COL и ROW.
Существует набор enum для выбора элементов. /> < /ul>
Примечания: < /p>
Ninjatrader больше не использует формы и теперь использует wpf. < /li>
Я не хочу интерфейс Web /XML или HTML. Just C# используется в сетке. src = "https://i.sstatic.net/v0u32h2t.png"/>
Пример кода:
#region Enums
namespace Profit_Bot_Enums
{
public enum MySystems
{
[Display(Name = "NotSet")]
NotSet = 0,
[Display(Name = "PrevBarHbuy")]
PrevBarHbuy = 1,
[Display(Name = "OldSystem")]
OldSystem = 2
};
}
#endregion
#region System-r3
this.SystemLabel = new Label
{
Content = string.Format("System Strategy: ", 0),
Height = 20.0,
Margin = new Thickness(4.0, 0.0, 4.0, 0.0),
Padding = new Thickness(0.0, 2.0, 0.0, 2.0),
HorizontalAlignment = HorizontalAlignment.Center
};
this.SystemLabel.Foreground = Brushes.White;
this.SystemLabel.Background = Brushes.Transparent;
this.SystemLabel.BorderBrush = Brushes.Transparent;
this.SystemLabel.HorizontalAlignment = HorizontalAlignment.Center;
Grid.SetColumnSpan(this.SystemLabel, 1);
Grid.SetRow(this.SystemLabel, 3);
grid5.Children.Add(this.SystemLabel);
string formatSys = string.Empty;
#endregion
#region button-r3_text
this.systemsLabelVal = new TextBox
{
Text = string.Format(this.systemsValue.ToString(), 0),
Height = 20.0,
Width = 60.0,
FontSize = 10.0,
HorizontalAlignment = HorizontalAlignment.Center
};
this.systemsLabelVal.Foreground = Brushes.White;
this.systemsLabelVal.Background = Brushes.Transparent;
this.systemsLabelVal.BorderBrush = Brushes.Transparent;
this.systemsLabelVal.HorizontalAlignment = HorizontalAlignment.Right;
this.systemsLabelVal.VerticalAlignment = VerticalAlignment.Center;
this.systemsLabelVal.TextAlignment = TextAlignment.Center;
Grid.SetColumnSpan(this.systemsLabelVal, 3);
Grid.SetRow(this.systemsLabelVal, 3);
this.systemsLabelVal.PreviewKeyDown += this.TextBox_PreviewKeyDown;
grid5.Children.Add(this.systemsLabelVal);
#endregion
#region Systems button-r4
this.Systemsbtn = new Button
{
Content = string.Format("None", 1),
Name = "None",
Height = 30.0,
Margin = new Thickness(4.0, 4.0, 4.0, 0.0),
Padding = new Thickness(4.0, 0.0, 4.0, 0.0),
Style = style
};
this.Systemsbtn.Background = Brushes.Gray;
this.Systemsbtn.BorderBrush = Brushes.DimGray;
this.Systemsbtn.Foreground = Brushes.White;
this.Systemsbtn.Click += this.Systemsbtn_Click;
Grid.SetColumnSpan(this.Systemsbtn, 3);
Grid.SetRow(this.Systemsbtn, 4);
grid5.Children.Add(this.Systemsbtn);
#endregion
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
}
private void Systemsbtn_Click(object sender, RoutedEventArgs e)
{
}
< /code>
Спасибо за любые идеи о реализациях! < /p>
Я попытался установить значения enum в разных местах в коде. Мне еще предстоит найти правильный способ реализации.
Подробнее здесь: [url]https://stackoverflow.com/questions/79744954/ninjatrader-drop-down-box-to-fill-textbox-value-or-button-text-value-c-with-wp[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия