Giter Club home page Giter Club logo

xrails-login-ui's Introduction

Synopsis

This project was heavily inspired by a concept design called "Simply Login" I found on Dribbble. It was made possible for WinForms by designing a bunch of custom, fully functional controls with GDI+ and cramming them into one form to produce this excellent result. Eye candy, eh?


Controls

Control Inherits
XRails_Button Control
XRails_Container ContainerControl
XRails_ControlBox Control
XRails_Label Label
XRails_LinkLabel LinkLabel
XRails_LogoBox Control
XRails_Panel Panel
XRails_TextBox Control
XRails_TitleLabel Label

Note

The control XRails_TitleLabel uses a user-defined font called Raleway-Light. Because the font will not be installed on the local machine, it needs to be loaded into memory during application runtime using the PrivateFontCollection class in order to be applied. See the demo project to find out how it's done.

Raleway is an open source font developed by impallari, and can be found on Google Fonts as well.

Requirements

Implementation

The core project compiles into a single dynamic link library. Meaning that once it is compiled, it can be referenced and used in any WinForms project across the .NET platform.

Note: since the compiled .dll contains a set of controls, referencing it to your project itself will not result in showing the custom controls in your Toolbox pane. It is better to do the following:

  1. On your Toolbox pane, right-click and select Add Tab. Name it and confirm.
  2. If not running the IDE as administrator, drag and drop the .dll on the newly created tab and the controls will be listed. Otherwise,
    1. Right-click on the new tab and select Choose Items...
    2. Press Browse... and navigate to the .dll file.
    3. Press OK to confirm. The custom controls should now be listed.

Once any of the controls is placed on a form, the library should be automatically referenced.

Hacky

Ok, look. If you saw the screenshot above closely, you have probably noticed the alien window frame. That right, it is a custom control as well. But how?

There are two controls that make up the custom window frame: XRails_Container and XRails_ControlBox. The Container control, once placed, will override the form's FormBorderStyle property by setting it to None. That alone is not sufficient. The ControlBox control is also needed here. It basically acts as the Minimize, Maximize, and Close buttons. Once placed, it will automatically re-adjust location when the project is built or debugged.

Any drawbacks? Absolutely. Natively speaking, when you set FormBorderStyle = FormBorderStyle.None;, Windows will disable many things, and that includes: ability to resize form, drop shadow, and DWM form animations.

What about a workaround? Sure -- although not entirely. Form resizing during runtime can be easily coded and implemented in XRails_Container, but the functionality is not needed for a project like this. Thus, it is not a problem here. However, it is hacky when it comes to drop shadow. You will need to override CreateParams to modify the parameters of the form and WndProc to intercept window messages.
As for DWM animations (eg. minimize/maximize/restore), going borderless makes them near impossible to achieve. I have yet to discover a solution for that. However, I did create a simple fade in/out animation for the form when the application is launched or closed. I highly recommend you have a look at the demo project form to see how everything is done.

Keep in mind that XRails_Container is optional! You do not have to override the default window frame. It was made purely to unify the look of the application on any Windows version.

Legal

This project is distributed under the terms of the MIT License.

xrails-login-ui's People

Contributors

ei avatar xv 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.