|
Как написать более красиво?
|
|||
---|---|---|---|
#18+
Скажите пожалуйста, как написать более красиво (без e.ClickedItem.ToString() == "Добавить")? автор public void view_MouseUp(object sender, MouseEventArgs e) { ContextMenuStrip contexMenuDoc = new ContextMenuStrip(); if (e.Button == MouseButtons.Left) { return; } contexMenuDoc.Items.Add("Добавить").Enabled = true; contexMenuDoc.Show(Control.MousePosition); contexMenuDoc.ItemClicked += contextMenu_ItemClicked; } public void contextMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.ToString() == "Добавить") { newForm f = new newForm(BindingSource); f.ShowDialog(); } } Заранее благодарен. ... |
|||
:
Нравится:
Не нравится:
|
|||
05.12.2013, 17:02 |
|
Как написать более красиво?
|
|||
---|---|---|---|
#18+
Код: c# 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35.
... |
|||
:
Нравится:
Не нравится:
|
|||
05.12.2013, 17:23 |
|
Как написать более красиво?
|
|||
---|---|---|---|
#18+
Я может чего-то не пойму, но почему не Код: c# 1.
Или так нужен один обработчик на все итемы? ... |
|||
:
Нравится:
Не нравится:
|
|||
05.12.2013, 17:44 |
|
|
start [/forum/topic.php?fid=20&msg=38490742&tid=1403556]: |
0ms |
get settings: |
11ms |
get forum list: |
16ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
44ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
51ms |
get tp. blocked users: |
2ms |
others: | 320ms |
total: | 466ms |
0 / 0 |