|
if you need help i develop program with visual c and visual basic my e mail is albertodiprima@hotmail.com
|
|
|
|
|
... and you have been a member of CodeProject long enough to know that the forums are not the appropriate place for free advertising.
The best things in life are not things.
|
|
|
|
|
i write and study code i'm not playing
|
|
|
|
|
Why you want to get clients here in CodeProject?! In your place where you live there people don't use computers?
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
I am planning a memory game (as an exercise for myself) and thought of loading pictures, probably gifs or pngs into PictureBox controls like Microsoft does in this tutorial.
http://msdn.microsoft.com/en-us/library/dd492173.aspx
I would like to have the opinion of more experienced members in this forum, and mostly an answer to the following. During the game, two pieces will be revealed to the player for X seconds and then, in case he/she fails, they will have to be covered again. What does this mean in programming terms? I think that loading a picture and then loading a blank one would be a solution but probably a bad one, provoking unnecessary traffic. I have no better idea for the time being What do you think?
Thanks in advance.
PS: In those tutorials the last one is a Memory game, but with fonts.
http://msdn.microsoft.com/en-us/library/dd553233.aspx
What I am trying to do is to combine the techniques of those two tuts.
|
|
|
|
|
Sounds like a good enough solution to me. You could either set the visibility of the picture box control to show/hide it, or replace the image with a "blank" one you already have - it all depends on the aesthetic you're going for.
I would suggest pre-loading all the images (including the blank one) at startup and keeping them in memory (remembering to free them on close, GC may handle this for you, can't quite remember with images...). If you have a reasonable number of images, then this should be fine. Remember you'll only need one in-memory copy of the blank one although it may be used for all tiles.
Another solution would be simply to draw something over the top of the images in order to hide them, for example a black rectangle or another image. This may be another solution worth looking into.
Seems like you're on the right track though. Good luck!
Typical n-tiered architecture:
DB <-> Junk(0) <-> ... <-> Junk(n-1) <-> Pretty
modified on Wednesday, July 27, 2011 6:55 AM
|
|
|
|
|
Thanks for your reply.
I'm not quite sure, that I know how to do the following.
GlobX wrote: pre-loading all the images (including the blank one) at startup and keeping them in memory
GlobX wrote: you'll only need one in-memory copy
Could you give me any hint please, on what you refer to, please?
Thank you.
|
|
|
|
|
nstk wrote: I'm not quite sure, that I know how to do the following.
GlobX wrote: pre-loading all the images (including the blank one) at startup and keeping them in memory
I would suggest creating a class that contains a List of bitmaps.
St the bitmpas to your images on startup.
You can then point the pictureboxes on the form to the appropriate bitmap when needed.
This way the images are kept in memory within the List.
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
In Oracle you can fire events via a trigger eg on insert and catch that event in your application.
I searched a little bit on this and found that the ODP.Net provider allows this. However, it looks a little complicated and before investing time into researching this route I was wondering if:
-> Someone has experience in this (catching events from the DB)? Any advice?
-> This can can be done with the OleDb provider as well, which is the provider we use today?
Many thanks.
V.
|
|
|
|
|
I've never done it, but I can tell you that OleDb will not work for this. It doesn't support database notifications.
Notifications from the database have to use the native provider for the database engine.
|
|
|
|
|
mmm Ok thanks. Good to know.
V.
|
|
|
|
|
Probably not a good design/architecture idea even if you could do it.
|
|
|
|
|
OK, can you also explain why?
V.
|
|
|
|
|
When you have two disparate systems almost always one is deemed the 'client' and the other the 'server'.
In such architectures the client is considered to be transitory and the service is permanent.
And certainly with relational databases that is always true.
With a client/server the establishment of the connection is from the client to the server.
And functionality is structured such that the client acts on the server.
Permissions are also structured that way.
Thus the server as an entity never needs to know that a specific client exists. The server need not concern itself with when the client stops, starts nor anything else about the client.
Attempting to have a server notify a client of course contradicts all of that.
Questions along this line are almost always satisfied by polling by the client. And especially when the client is a user management interface of any sort that is always a better solution.
|
|
|
|
|
Thanks for the reply.
I don't totally agree, but I see your point of view.
V.
|
|
|
|
|
There is a wierd problem: in the windows form I added ToolStrip, which docks to top and then added ListView to span entire form by design.
When I set its dock property to Fill it was docked below ToolStrip.
I expected the docking would not interfere with ToolStrip and stop exactly at its bottom border?
Thus ToolStrip occludes by itself top part of the ListView control.
Чесноков
|
|
|
|
|
Select the ListView control, click Ctrl+X (Cut), click the form and then click Ctrl+V (Paste). Your problem should be solved. This weird problem happens because docking depends on the order in which controls are added to the form.
|
|
|
|
|
many thanks that solved the problem.
I never paid attention to the addition order of the controls to the form.
I remeber there were no problems with docking before due to that issue as it turned out
Чесноков
|
|
|
|
|
|
You can also do it with Move to Front/Back on the controls. Send the toolbar to the back.
|
|
|
|
|
It's not about the z-order Bob, it's how the docking mechanism works in WinForms. Sending the Toolbar back will permanently hide it behind the ListView at runtime.
|
|
|
|
|
It is not about the Z order, true, but 'Send to Front/Back' in the VS designer changes the creation order of the components, so it changes the docking order. By default the Z order is also based on the creation order so the function kind of does both things. I've had to do this myself for docked controls and splitters.
|
|
|
|
|
It works , Nice trick, thanks.
|
|
|
|
|
hello...
when i wase test my solution, i found exception.
message is...
----------------
The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone).
----------------
that is riaseup after this code
p_han = OpenProcess(1, false, (IntPtr)ps.Id);
TerminateProcess(p_han, 0);
CloseHandle(p_han);
this code is kill process from my ui form command.
why raiseup is exception ?
|
|
|
|
|
There's not enough information to troubleshoot this. The message your exception is supplying has, on the surface, nothing to do with the code you posted.
One problem I see is that your opening a process, then killing it while you have the process open. Try closing the process first, THEN killing it. It's entirely possible that the handle you get in the OpenProcess line is no longer valid when you try and Close it.
Frankly, this reeks of copy'n'paste coding.
|
|
|
|