Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Rahu
Feb 14, 2009


let me just check my figures real quick here
Grimey Drawer
Really easy question because I can't figure out what to type into the google.

I'm learning winforms and making a very simple program to try out various stuff, and I'm trying to add a small options screen with some configuration info in it.

What I want to do is make it impossible for the main window to have focus as long as the options window is up, as many programs do. I'm sure there's some simple way to accomplish this but I can't seem to find it.

Adbot
ADBOT LOVES YOU

Rahu
Feb 14, 2009


let me just check my figures real quick here
Grimey Drawer
I'm learning WPF and having some performance-related problems. I'm trying to make a simple telnet client and chose to use a custom control for the main text display.

My problem is that I'm having horrible performance when attempting to draw this.

The method I'm using to draw is simply to loop through every place in a grid where a character exists, and then using DrawingContext.DrawRectangle to draw in a background color and DrawingContext.DrawText to write a character over that rectangle.

For the default size, this means 80*24 (1920) rectangles/characters must be drawn. I know that this is certainly "a bunch" of things to draw, but I assumed it still be a small enough amount that it wouldn't hurt the redraw speed significantly. As it stands, resizing the window is horribly slow and sluggish.

Is there some better way for me to be drawing all of this or some horrible misunderstanding I'm having here?

Rahu
Feb 14, 2009


let me just check my figures real quick here
Grimey Drawer
I'll probably end up using a standard text control, but first I wanted to give making a custom one a try just to see if I could (I can't :saddowns:)

Trying to cut down on what the loop rendered wasn't especially helpful, drawing either the text or background on its own led to bad performance and both together was worse.

Welp, gave it a try. Thanks for suggestions :)

  • Locked thread