Problem in moving images in C# [closed] - c#

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I asked a question about moving images with timer in c# . Some people said to me to use WPF. But I never worked with WPF before. I looked msdn but don't understand it.
Please help me, I really need this soon.

I would suggest you to have a look at Expression Blend video tutorial. Learning and implementing wpf without out tools like Expression Blend is quite challenging. http://expression.microsoft.com/en-us/cc197141.aspx

In short, in WinForms (I assume you use WinWorms when you don't use WPF) to animate some elements on the screen, so the following:
Override the forms OnPaint method, and inside there, draw the image(s) on the desired positions.
Make a backgroundworker tat support sending progress.
In the backgroundworker calculate the new positions, then call ReportProgress.
In the report progress event method, redraw the images on their new positions.
Remember to set the forms DoubleBuffered property to true so that the redrawing is done smoothly.
Good luck! :)

Related

Finding a hidden Button [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I played in the past on partypoker and worte my own window arranger. it arranged the windows based on a visible button, but today i switched to a different room.
the problem is that i cant find the button with spy++. spy++ doesnt recognize that there is a button. some buttons are findable with spy++, but not the one i need
any ideas how i can find this hidden button ?
If the button is not an actual button (i.e., if it's drawn through code rather than using the standard Win32 button control) you're not going to be able to find it with Spy++. It won't be an actual window, so it won't have a window handle. Thus, you're also not going to be able to click it through the normal mechanisms, like sending it a BM_CLICK message.
It's possible that they're doing this as a security feature, but it's also quite likely that this is part of the growing trend away from using the native UI controls, one that I very strongly disagree with and whose motivations I seriously question.
Your only hope is probably UI automation, which is very tricky to get right. Make sure to test the program in a virtual machine so the world doesn't end when you inevitably click the wrong thing accidentally.

What is the logic behind game coding, moving graphics simultaneously? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was reviewing a code from a simple PONG game code in c#, the logic as far as I could understand was reading a key press (UP and Down) in a infinte loop and update the position of the ball and bar each n milliseconds one after another.
I want to know how to draw objects on a graphic box simultaneously?
I am just interested in making simple games using a imagebox and simple graohics.
If you want to make really simple games like Tetris or other puzzle-like, you could simply drop the "infinite loop" part. I've seen plenty of simple games built with Winforms/user controls/standard events (keypress/mousemove...).
If you plan to write something more complicated, then you probably want start learning XNA. Microsoft kindly provides useful starter kits.
You don't do it simultaneously, you do it in a loop but that loop happens so fast that a human cannot tell they are being updated one at a time.

Lock Mouse in primary screen [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have an application which use secondary monitor to display content. I dont want user to move curser to secondary monitor. I need to restrict the user to use mouse in primary monitor only. How can i do this.
Thanks
The following article describes creating a global hook: Global Hook (code project)
I think this is closer to what you're asking because you wouldn't want to continuously poll with GetCursorPos() function, mentioned in the other answer. However, using the hook and the MouseMove event handler, I would use SetCursorPos() to keep it within bounds.
Cheers,
Jonno
http://pinvoke.net/default.aspx/user32/GetCursorPos.html
http://pinvoke.net/default.aspx/user32/SetCursorPos.html
Use PInvoke to import the calls from the library and simply check the cursor position and adjust accordingly. You might need the resolution size of the monitor to check if it's within the bounds of the first or second screen.

tooltip catcher c# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to create an application which can copy the tool tip (the tool tips which are shown on the current desktop/window) if I press hot keys. So how can I track whether the current desktop having a tool tip.
First, its not possible to use the Managed.Net API to access windows in other applications so you will have to do somthing a bit different.
I guess you could use the Win32 API to enumerate windows and find those of the class Tooltip_Class32. Then you'd have to read the text on them.
You can enum windows as described on SO here and on PInvoke.net here.
If you limit to just the Tooltip_Class32 then you will only get the tool tip windows.
I'm not sure how windows contructs a tool tip. I'm guessing you can read the text from the tool tip or from some child control window by using the SendMessage API with the WM_GETTEXT message like here.
That should get you started, I've never actually done it myself but it seems feasible.

UI interface Builder c# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
i want the ability to create a UI designer (Winforms/WPF/UI/User interface type agnostic).
The requirment is that it should be possible to add properties to a device and it should automatically turn up in the UI.The addition of properties would be via a admin screen.
eg. there is a UI object called Order.It should be possible to add a property called ordersoomething to the order object from the admin screen and it should automatically reflect in the User interface.
i am looking for something that is already available (Open Source/existing stuff etc).
Edit based on a couple if comments.
What i mean by UI agnostic is that i am looking for a architectural pattern. That would fit well.it should not matter if it is Webforms or Silverlight or Winforms.
Regards
David Xavier
Since you tagged this C#, make sure you know about VS LightSwitch
There is a DevExpress Application Frameowrk, something called XAF, see the Developer Express website, it's not for free but not too expensive considering what you are asking, I am not sure if it only targets WindowForms...

Categories