I have an image, And I want to create an effect like Windows 8 start menu when user clicks on it.
I mean, if this is my image:
When user clicks on it, it should change to something like this:
I mean, a little 3D effect.
How to create this effect in code behind? (On MouseDown event)
As you requested I'm posting my answer again:
Solution to your issue is covered by another SO question:
C#/WPF image transformation over a trapezoid
Hope this time it wont be automatically converted to comment :)
Related
I am trying to make transparent (legacy) buttons in unity. I want to be able to see the button text, but not see the background button image (aka the 'clickable' area). I am not asking about hiding/showing the button and the text completely.
I have tried disabling the button, removing the Target Graphic image, setting the alpha values to 0, but none of these seems to have any effect.
Do I need to just remove the button object and write some sort of script that hangs off a text object to detect clicks?
Addendum: Geode's suggestion works nicely. Either deleting or disabling the image component will solve this problem.
I think you've been looking in the wrong area, above your Button component there is an image component which handles the graphics part of your button. Disabling or removing that will remove the white background.
Here you can see the location
At the start - i'm starting with windows forms/making desktop applications.
So, I'm moving my program from javascript to c# - desktop app, with full user interface and etc. and I have 2 questions:
I added textbox, and checkbox, it looks good until I highlight the text or it also looks good only if the background behind the app is white in every other case it looks like that, here the image :
How can i fix that?
2nd question:
I had the issue with the texboxes - the borders were invisible and when i clicked them windows was focusing on the app behind my program. I fixed it with changing border from "fixed3D" to "fixedSingle", I also had the same issue with the listbox (under the texboxes) also changed the border to "fixedSingle", but it's loosing now focus when i click the text inside this. How can i solve that? + maybe make the program to not hightlight the text on click in listbox? - it looks better without it
I'm wondering if there any solution that could make the app automatically adjust the controls position when the keyboard is activated. For example, in the image below, I want to make those four button on the screen move dependently with keyboard. When the keyboard is activated, buttons move to the center and move back when the keyboard is gone.
There might be some similar questions here but I couldnt see them in the search result, maybe they are using some different words on title so if this question is duplicated it will be appreciated if you guys could paste the link on comment or whereever.
The idea is you can listen to the Showing and Hiding event of the InputPane. In the event handler, you adjust your UI layout with respect to the keyboard.
For example, you can realign the button relative to the height of the keyboard.
For more information on InputPane, refer to https://msdn.microsoft.com/EN-US/library/windows/apps/windows.ui.viewmanagement.inputpane.aspx
For dynamically align the UI layout example, refer to
https://code.msdn.microsoft.com/windowsapps/Keyboard-Events-Sample-866ba41c
I have button it possible create animate on click?
with photoshop i have created a two image (enabled and disabled). Insert the picturebox in Windows Forms and Click event..Click the image changes from enabled to disabled, but you can have an animation?
Like this:
It looks like you mentioned WinForms so I'll address that. Yes animation is possible but in general it's going to be a bit of work.
There appears to be an implementation of a general purpose animation framework (although limited) over on CodeProject. In the comments schallos posted a better implementation of the reflection code using expression trees.
The general principle is:
Use a PictureBox so you get double buffering
Use a timer control to control repainting (calling Invalidate() on your PictureBox)
You'll probably want to add some easing into the animation so it appears smoother; a bit of acceleration added to it when the user clicks goes a long way.
A timer is not required using a GIF.
Using windows forms you could start by creating an animated GIF for each button. It would have to include both the forward and backwards direction. You can do this through Photoshop via the "Animation" panel. On the PictureBox click event you can set the image to play or stop.
The code below would set your image on the beginning frame.
imgButtonDimension = new FrameDimension(imgButtonDimension.FrameDimensionsList[0]);
imgButton.SelectActiveFrame(imgButtonDimension, 0);
pictureBox.Image = imgButton;`
If this is the approach you'd like to take I can provide further elaboration.
Is there any built-in control like a dropdown/slider? For instance, I want to display some info on dialog/control/form and inside that form there is a arrow which expands it to show more information?
alt text http://img227.imageshack.us/img227/4945/73068794.jpg
When I click the black arrow, the form should expand vertically to show more info. That's what I want to achieve. If there isn't any built-in control, can you please tell me what do I need to do to implement it myself? And how can I add a little animation when it is expanding?
Like here (when you click the menu header it doesn't expand/contract instantly rather it does little slowly, that's the kind of animation I would like to add)
This CodeProject article should help you get started.