|
Is it possible to make a button lose it's focus once a mouse has passed it? (i mean, if it's clicked and held down and then the mouse moves out of the button).
for example, the buttons in Minesweeper are like that. so, is there any way to do so?
|
|
|
|
|
Set the focus to something else.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
but how would i know which button to set the focus to? (did you even look at minesweeper to see what i meant?)
|
|
|
|
|
sharpiesharpie wrote: but how would i know which button to set the focus to?
Don't set focus to another button. Set it to a panel, or a label, or anything else. Panels and labels are good because they don't show as focused.
sharpiesharpie wrote: (did you even look at minesweeper to see what i meant?)
Wow! Way to get pissy.
|
|
|
|
|
In Minewseeper they might look and act like buttons, but there's clearly some additional functionality built in, not to mention the actual Minesweeper "grid" itself.
To emulate that, I think you're going to have to spend a bit of time developing your own custom control - although this will clearly take a bit more time, it will afford you much finer control (pun intended )
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
Well...i did make a custom control, a panel that has an array of rectangles in it into which i render images, but it was EXTREMELY flickery for some reason (even though i used a backbuffer) :/
|
|
|
|
|
In a situation with over one hundred controls, the obvious solution to flickering
(and lack of performance about which you will complain later on) is the lightweight
approach: forget Buttons, use a double-buffered Panel, draw everything yourself,
and handle the necessary mouse events yourself.
I guess that's how Microsoft did Minesweeper; they use 57 GDI objects, both in Beginners
and in Expert mode, according to TaskInfo.
|
|
|
|
|
i did draw everything myself, i drew images on a panel and overrided the mouse movements and added a basic collision detection...but it did flicker :/
|
|
|
|
|
Hi,
when a Panel does not contain any other Control, has double-buffering set up correctly,
and has all its drawing in its Paint handler, the only way I can think of to get flickering
is by having a bug in either your animation logic or your paint logic (unless you are
showing/hiding other stuff on top of it of course).
I have several apps that work this way, including a complex text editor; all work just
fine, not a single glitch to be seen.
As most often, my advice is to include code for logging/tracing so you can check
things happen when they should, and more importantly in this case, dont happen
when they should not.
|
|
|
|
|
I am debugging managed code (c#) that calls into unmanaged code (c) in a semi-production environment. I cannot install VS there. So, I am using Windbg and I have all the symbols for windows, managed and unmanaged code.
I set a breakpoint in a function in unmanaged code and want to see the full stack trace of where the call originated from in the Managed Code. But all I see is on the stack is calls from .net framework and nothing from my C# classes and functions.
Does anyone know how to get the full stack trace?
|
|
|
|
|
Hey every one ,, i am new programmer and i am working on a project (Electronic phone book ) and i need some help, the code is finished and my application works fine ,, what shall i do next ,how can i make it usable for every one ?!!!!
Rasta Man beta3 Zaman
|
|
|
|
|
sudany_zool wrote: the code is finished and my application works fine
Excellent - Well done!
sudany_zool wrote: how can i make it usable for every one ?!!!!
I thought you said it was "finished" and "works fine"? If it isn't usable then it isn't finished.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
sudany_zool wrote: how can i make it usable for every one ?
Write a quality article about interesting points in the project and place here on Code Project.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
First, upload it to a public server. Then find the email address for "everyone" and write them a nice notice. Oh but wait, you said "usable" for everyone... You'll have to use some globalization and get everything translated to about a thousand languages... And you'll also need to work out a way to get computers and connectivity to all the head hunter tribes in South America, nomads in Mongolia (maybe wireless is the best here), and all the dirt poor people suffering in Africa and Russia. And don't forget all the old ladies all over the world that barely have a phone. Then you have to worry about blind people and other handicaps that make using a computer difficult. And retards too. But if you mean animals and aliens too, I can't help you.
|
|
|
|
|
So now is the time to perform market analysis and write product specifications.
|
|
|
|
|
But how many phone book database apps are already out there? He needs to see where his stands out from the rest of them. Is it ease of use, etc?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Exactly.
Gartner Group or Boston Consulting Group should be called in.
Or maybe Google is already preparing a takeover ?
|
|
|
|
|
I want to find first duplicate occurence in an array. Can I do it without O(n2)
???
|
|
|
|
|
go through the array and use a dictonary<object, int=""> where object is the array element (or some unique identifer for the items in your array) and int is the count of occurances. go through the array once and add items into the dictonary if it doesn't exist, or increment the count value (the dictonary is a hash so it will be really fast in finding the key/seeing if it exists). after going through the array once, iterate each KeyValuePair in the dictionary and look for any int values greater than 1. your complexity is about O(2n + 1).
|
|
|
|
|
Hi,
in pseudo-C#
List myList=empty;
foreach (element elem in inputcollection) {
if myList contains elem throw new FoundDuplicateException(elem)
else add elem to myList
}
|
|
|
|
|
Is this a homework question?
1. Sort the array but keep track of the original positions.
2. Set FOO to size.
3. Compare n with n+1 to find duplicates.
If the original positions of the duplicates are less than FOO,
set FOO the larger of the original locations. This assumes a number can be repeated once,
but it is not hard to modify for multiple occurrences.
4. If FOO == size, there are no duplicates
else FOO is the location of the first duplicate.
Step 1 is O(nlogn)
Step 3 is O(n)
|
|
|
|
|
Hi again
i am working on a C# windows program and i am trying to make some control just like what we have in OS or office 2003. but i can't find the color code that change with changing system default Theme. we have 3 default theme on XP, blue green and Gray, how can i paint my control or their background with for example the special blue gradient we have on background of Windows explorer search pane?
thanks a lot.
|
|
|
|
|
Good question I wondered about that too. My suggestion at this point it too download some of the samples here and see how others did it. It should be in there. My best guess is that the various Explorer bars and outlook 2003 bar implementations should contain just what you need.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
|
It depends on what you are trying to change. If you want to change the colors of the toolstrips, menustrips, and statusstrips, you will need to create your own renderer that derives from ToolStripProfessionalRenderer and your own color tables that derive from ProfessionalColorTable . You can then set the ToolStripManager.Renderer property to your renderer. You will need to change the RenderMode property on the toolstrip, menustrip, and statusstrip to ManagerRenderMode as well.
|
|
|
|