jfo's coding

adventures in windows forms and wpf

Browse by Tags

Tagged Content List
  • Blog Post: High DPI - it's an everyone thing.

    As larger displays are becoming more popular, they're increasingly being used in places like the livingroom. And if you've ever tried to read text across the room with the default DPI setting, you'll find you may need a pair of opera glasses. In Windows 7, if you're using a larger display, the OS...
  • Blog Post: Avoiding throwaway layout/painting/mouse code

    I’m not normally a Hungarian fanatic or anything, but it is quite easy to create “write once” layout/painting code. If there’s ever a problem with the math the code needs to be tossed out because it’s too confusing or too difficult to update. I think we've all either seen this kind of code and/or...
  • Blog Post: How can I remember which order Margin properties are set?

    Often you can stare at a margin property "10,20,30,40" in XAML and be slightly confused as to which is which property. If I have to deal with a format over and over again I will come up with a trick to remember how to work with it. My trick is to remembering Thickness/Margin is by saying "LTRB" as...
  • Blog Post: VB6/Winforms interop

    Check out the Microsoft InteropForms Toolkit 1.0 This toolkit helps you bring the power of .NET to your existing VB6 applications, by allowing them to display .NET WinForms from within the same application. Instead of upgrading the entire code base, these applications can now be extended one form...
  • Blog Post: Josh seems to be having fun with Renderers

    It looks like he's put together a very convincing VistaToolStripRenderer , and promises a tell-all series of articles. Stay tuned!
  • Blog Post: Workaround for disabled flyouts

    Frans ran into some trouble disabling parent menu items. Turns out they dont disable the evaluation of child shortcuts. This was an oversight on our part. That said, most applications remove flyouts that are not in-use so as to not taunt users with menus they can't click on. =) Here's a quick workaround...
  • Blog Post: Win32 Activation and Focus

    For the most part, activation and focus work pretty darn well in windows, until you want to tweak something that doesn’t fit within the typical windowing model or roll your own menu. Most folks don’t separate out activation and focus, but they are really separate things. Experimenting for a moment...
  • Blog Post: Rule of thumb for System.Drawing

    A friend of mine ran into this the other day. If you call a method to get a handle some sort of System.Drawing object, you may be creating an object that needs to be cleaned up through P/Invoke or some other function call. Bitmap.GetHIcon - requires p/invoking DestroyIcon . Font.ToHFont - requires...
  • Blog Post: Tim resurfaces with another control

    I enjoy talking to Tim Dawson quite a bit; we both know that making the decision to build your own menu is not one to be taken lightly. He's been busy lately .
  • Blog Post: How do I detect when the WindowState changes?

    Most of the time, you can get away with checking it in the Form.SizeChanged or Form.Resize event. If you remember, there's no difference between the two events so it doesnt matter what you pick. However it was pointed out to me that if you specify a maximum size for your window, this methodology wont...
  • Blog Post: Tim shows how to get glass in your client area using Windows Forms

    Here's how to do it . (Requires Windows Vista and some willingness to fiddle with how your app paints itself).
  • Blog Post: ToolStripManager.SaveSettings and UserControls

    Ingas asks a great question: In windows form I have a ToolStripContainer inside a control (inherided from UserControl). I allso have a ToolStripContainer on the main form. I am trying to do ToolStripManager.LoadSettings() (with ToolStripManager.SaveSettings allready done earlier) - supplying the...
  • Blog Post: Windows Forms documentation team is blogging

    Welcome the folks behind the reams and reams of Windows Forms documentation to the world of blogging! In their own words: We're the Windows Forms User Education team at Microsoft. Here you can find updates on documentation related to Windows Forms, ClickOnce, and Smart Client programming months...
  • Blog Post: WM_GETCONTROLNAME

    Folks quite often ask how to get information about controls from outside the process. In addition to active accessibility (the recommended solution for testing windows forms applications) there's also a handy window message which Control supports called WM_GETCONTROLNAME . Calling SendMessage with WM_GETCONTROLNAME...
  • Blog Post: ProfessionalColorTable - what does what?

    If you've read the ToolStrip FAQ, you may already be aware that you can replace the colors of the ToolStrip by passing in a new ProfessionalColorTable to the constructor of the ToolStripProfessionalRenderer. How can you tell what color does what? Create a form, then add in a property grid and set...
  • Blog Post: Using Windows Forms on Windows Vista?

    Brad wants to know your experiences...
  • Blog Post: Updates to the SplitButton sample

    David was kind enough to point out some rough spots in the SplitButton sample , so I've gone ahead and updated it with his suggestions for fixes. Please let me know any other suggestions as this seems to be a popularly-reused sample.
  • Blog Post: Perf, Text Renderering and Designer hosting

    There are three great articles from the Windows Forms team to read in the March issue of MSDN Magazine: Winning Forms : Practical Tips For Boosting The Performance Of Windows Forms Apps Milena Salman Text Rendering : Build World-Ready Apps Using Complex Scripts In Windows Forms Controls Miguel...
  • Blog Post: Ben talks about writing Managed Spy++

    Ben has written a great article for the April issue of MSDN magazine. You can see it online here . Basically the idea was to write a tool that would allow you to inspect properties and events while your form is running. This tool can be quite handy for debugging layout if you want to see what's inside...
  • Blog Post: How do I display a radio button on a MenuStrip?

    MainMenu had a feature called RadioCheck, which simply displayed a circle next to the selected option. Specifically, RadioCheck was a feature of MenuItem - if "RadioCheck" and "Checked" were true, a round ball would show up instead of a checkmark. There's no one property that lets you have that ball...
  • Blog Post: Straight from the dev: DataGridView whitepapers

    Regis, the dev on DataGridView has put up two new whitepapers on creating custom columns. Check it out .
  • Blog Post: A different kind of key altogether: keyed collections

    In most of the commonly used collections in Windows Forms 2.0, you'll find that they also take a string in addition to an integer index. The string corresponds to the "Name" property on the corresponding item. this.button1 = new System.Windows.Forms.Button(); this.button1.Name = "button1"; panel1...
  • Blog Post: New keyboard APIs: KeyEventArgs.SuppressKeyPress

    Here's the scenario: In 1.1 whenever someone types one character you want to replace it with another. (If you're thinking password textbox there's a TextBox.UseSystemPassword=true flag you should use). So you sync TextBox KeyDown, set handled to true and tack on some placeholder * at the end. ...
  • Blog Post: A new way of saying IsInputKey: PreviewKeyDown

    A year ago, I diagramed the maze that is Windows Forms keyboard handling . There are some new helper methods in 2.0 that I havent gotten a chance to mention, which I thought might be interesting. This first is PreviewKeyDown . If you've struggled before with having to override a class in order...
  • Blog Post: How do I get keyboard access to my ToolStripButton?

    I've gotten this question a couple times so I thought I'd share. If you want to allow keyboard access to your ToolStripButton, there are several options for doing so. Option A Classically, a toolbar button should be a duplicate of whats on your menu. If this is the case you don’t need it to be keyboard...
Page 1 of 4 (96 items) 1234