Skip to main content

Posts

Showing posts with the label develop

Create Custom WPF Tab Control Easily

Join me on Google+ Windows Presentation Foundation (or WPF) is a computer-software graphical subsystem for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0 . Rather than relying on the older GDI subsystem, WPF utilizes DirectX . Creating a Tab Control in WPF is pretty simple. Let's get through the steps one by one. Create a new Project. I am using VB as my language, you may C# if you wish to. :) A WPF Application Project will do fine. I believe in clean coding. I wish to add a couple of controls to this solution. Instead of adding them to the root, I will right click the solution and click "Add Folder", rename as something like say "Cus Tab Controls". Add a WPF custom control, name it whatever you wish. This will be the tabItem header. Here goes the code. I just added a harmless Label, and a Button, which will act as the Close Tab button fo

Control Hotkeys

Image Credits VNAMedia This weekend I plan to learn coding hotkeys and sending them to Winforms, basically for fun. I was testing the Control + N hotkeys and came up with some really useful text book material. This particular code was made to test things and worked great. I was happy and posted it here to ease the work for you. Public Const MOD_CTRL As Integer = & H2 'Control key     Public Const WM_HOTKEY As Integer = & H312     <DllImport ( "User32.dll" ) > _     Public Shared Function RegisterHotKey ( ByVal hwnd As IntPtr, _                         ByVal id As Integer , ByVal fsModifiers As Integer , _                         ByVal vk As Integer ) As Integer     End Function     <DllImport ( "User32.dll" ) > _     Public Shared Function UnregisterHotKey ( ByVal hwnd As IntPtr, _                         ByVal id As Integer ) As Integer     End Function     Private Sub Form1_Load (