WinForms: Disabling the close button

What is desired You do not want the user to be able to click on the Close button (the little “x” in the upper right). Method #1: The ControlBox property The WinForm ControlBox property is a good place to start, but it shows or hides the entire control box. That means it either shows or…

0

My most important lesson about designing User Interfaces

Look at your screen right now. What do you see? If you design software you’ll see things like: taskbars or docks or apps or notifications. HWNDs and DeviceContexts. start menus, systray icons, docked windows   What our users see a piece of glass with glowing shapes on it.   My point We who work in designing…

0

Python Design Principles

[Update 2007-09-01] These are available here: http://www.python.org/dev/peps/pep-0020/ as a Python PEP.   19 principles behind Python from Tim Peters: http://www.python.org/dev/culture.html Of the 19, these 9 are my favorites: Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. There should be…

0

Add a user to a local group

This scripts shows how to add a user to a local group on a machine. VBScript Example function add_to_local_group( machine, account, local_group_name ) set object_to_add = GetObject(“WinNT://” & account ) set local_group = GetObject(“WinNT://” & machine & “/” + local_group_name & “,group”) local_group.Add( object_to_add.AdsPath ) end function this_machine = “.” domain_account = “woodgrove/kevinp” ‘ Information…

0

Enumerating members of a Local Group

This code shows to find all members of a local group on a computer. It uses the NetLocalGroupGetMembers() from the win32net module.   Python Example:# —————————————- #requires win32 extensions for pythoon import os import win32net import win32netcon import pprint def get_members_of_local_group( computername, groupname ) : resume = 0 level = 2 retval = [] while…

0

Getting the name of current function

Useful snippet for debugging: A function that prints the name of the current function. To be accurate, it prints the name of the calling function. In C# this is called “reflection”. In python, it is called “introspection”. C# example// —————————————- using System; namespace ConsoleApplication1 { public class ReflectionUtil { public static string get_current_method_name() { System.Diagnostics.StackFrame…

0

Corner Cases, Contrived Cases, and Invisible Cars

Designing anything often involves breaking a situation into a finite number of cases and defining the software’s behavior in those cases. These are my views on two general kinds of cases.   A Corner Case   Your UI asks the user to enter their name. The user enters “Ryu & Cammi”  Yes, I know someone…

0

On the Importance of Naming and Describing Features

  A true story       NOTE: Names and details have been changed. However, I assure you the following conversation did occur. For the curious: I was Akuma, not Ryu.       Ryu produced a list of all the features in the product. Akuma scanned the list and found this item:    …

0