Giter Club home page Giter Club logo

winform.directui's Introduction

DirectUI for Winform

简介

  • DirectUI for Winform 是一个 winform 平台的界面库。

开发环境

  • .net framework 4.0

功能

  • 虚拟控件的无句柄渲染,支持重绘,方便扩展。
  • 图元支持,封装渲染方法,简化渲染操作。
  • 支持 win32 控件上无句柄渲染。
  • 消息分发,虚拟控件事件支持。
  • 动画接口,部分控件支持动画,可方便实现整个窗口渲染动画。
  • 实现部分虚拟控件。

暂不支持的功能

  • Tab 焦点切换。
  • 键盘快捷键支持。
  • 虚拟输入框控件。
  • 设计模式支持。

演示

  • 代码内包含一个示例。
  • 以下是一些常用的代码片段。
// 虚拟控件使用
private void Init()
{
    UIButton button = new UIButton();
    button.Size = new Size(70, 30);
    button.Location = new Point(5, 15);
    button.Text = “测试按钮”;
    button.Click += (sender, e) => MessageBox.Show("按钮单击");
    this.UIControls.Add(button);
}
// 虚拟控件重绘
protected override void RenderSelf(PaintEventArgs e)
{
    Graphics g = e.Graphics;
    Rectangle rect = RectangleEx.Subtract(this.ClientRectangle, this.Padding);
    this.Sprite.BackColor = this.BackColor;
    this.Sprite.Text = this.Text;
    this.Sprite.TextRenderingHint = this.TextRenderingHint;
    this.Sprite.TextAlign = this.TextAlign;
    this.Sprite.BorderVisibleStyle = BorderVisibleStyle.None;
    this.Sprite.State = this.State;
    this.Sprite.BeginRender(g);
    this.Sprite.RenderText(rect);
    this.Sprite.EndRender();
}

winform.directui's People

Contributors

timandy avatar caobingsheng avatar

Stargazers

MIAIONE avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.