Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snappey/consoleui
C# Console UI Toolkit
https://github.com/snappey/consoleui
Last synced: 29 days ago
JSON representation
C# Console UI Toolkit
- Host: GitHub
- URL: https://github.com/snappey/consoleui
- Owner: Snappey
- Created: 2015-02-06T22:19:27.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T19:42:21.000Z (over 7 years ago)
- Last Synced: 2023-02-28T03:46:09.718Z (almost 2 years ago)
- Language: C#
- Size: 142 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ConsoleUI
C# Console UI, easily create UI for console applications## Example
---#### Image
![Example Image](https://vgy.me/m8lmBh.png)#### Code Example
```c#
using System;
using ConsoleUI.Elements;
using ConsoleUI.Manager;namespace ConsoleTUI
{
class MainEntry
{
static void Main(string[] args)
{
Init();var p = 0;
Panel pnl = new Panel(5,5,90,15);
Label lbl = new Label(2,2,"Testing", pnl);
lbl.SetTextColor(ConsoleColor.Black);
Button btn = new Button(2,6,20,5, pnl);
btn.OnClick += delegate(object sender, EventArgs eventArgs) { lbl.SetText("Test#1"); };Button btn2 = new Button(24, 6, 20, 5, pnl);
btn2.OnClick += delegate(object sender, EventArgs eventArgs) { lbl.SetText("LOL"); };Button btn3 = new Button(46, 6, 20, 5, pnl);
btn3.OnClick += delegate(object sender, EventArgs eventArgs) { lbl.SetText("Asd"); };for (int i = 0; i < Console.BufferHeight; i++)
{
Label dbg = new Label(0, i, i.ToString());
}Footer ftr = new Footer();
Label count = new Label(Console.WindowWidth - 19, 0, "Button Count: 0", ftr);
Keys.ConsoleKeyPressed += delegate (object sender, Keys.KeyEventArgs eventArgs) { p++; count.SetText("Button Count:" + p); };Console.CursorVisible = false;
}private static void Init()
{
Console.BufferWidth = 120;
Console.BufferHeight = 31;
Console.SetWindowSize(120, 30);Hooks.StartEvents();
Keys.StartKeys();}
}
}```