Where are tooltip balloons in WPF? [duplicate] - c#

This question already has answers here:
How to implement Balloon message in a WPF application
(5 answers)
Closed 7 years ago.
In WinForms you used to be able to do this:
ToolTip hint = new ToolTip();
hint.IsBalloon = true;
as described here: How to show a .NET Balloon ToolTip? to display a balloon, as described by Microsoft here: https://msdn.microsoft.com/en-us/library/dn742400.aspx
Where is this functionality in WPF? I can find lots of people detailing how they wrote their own, but where has this functionality gone?
EDIT:
I understand that there are questions out there on how to write your own or what code is available, but I'm asking - does anyone know why this functionality is recommended by Microsoft yet not included in what is meant to be their recommended UI language (WPF)?

There are some libraries out there that can help you. The other answers are correct though, WPF can be styled to look like whatever you want, the principle is the same though.
Check out https://toastspopuphelpballoon.codeplex.com/ for a library that does balloon pop-ups on WPF.

Check out the tutorial here.
<Button Content="Submit">
<Button.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Submit Request</TextBlock>
<TextBlock>Submits the request to the server.</TextBlock>
</StackPanel>
</ToolTip>
</Button.ToolTip>
</Button>
You can then use typical wpf binding to bind the textblock control data to properties on your viewmodels (if you are using mvvm) if you would like.

Related

designing "pretty" user controls [duplicate]

This question already has answers here:
Creating a WPF Custom Control
(2 answers)
Closed 7 years ago.
I would like to create a user control which represents a pie chart and offers some mouse-over (tooltips / highlighting) and on-click events for the different parts of the chart.
However since i can not see how this could be accomplished by combining and restyling any of the standard controls the only thing i can think of is drawing the parts of the chart one-by-one using System.Windows.Shapes and to try to generate a pie chart by piecing those together.
Since "drawing" my buttons on the UI doesn't seem right, i would like to know if there is some other way to get such a result. Ideally the proposed solution allows me to apply styles to the chart so that it doesn't look flat, but can be adapted to the look of other controls.
In order to fulfil your requirements, you will need to create a CustomControl. You can find a basic tutorial in the How to Create a WPF Custom Control page on WPF Tutorial.net, but you will need to do more than shown there.
You can find a better tutorial in the WPF Control Development Unleashed book and luckily for you, someone uploaded a PDF version of it here... take a look at chapter 3.
Have a look at this site. It explains how to draw arcs and manage custom shapes.

How I can make a custom vertical slider in C#? [duplicate]

This question already has answers here:
Custom WPF Slider with image as Thumb
(2 answers)
Closed 7 years ago.
I'm learning C#, and I'm making a WPF Application.
The trouble is:
I have tried, but I don't know how to make a simple image object be a slider.
I have an idea to get values, calculating by the position of image object. I only need help to move the object image by the mouse.
Can you help me?
This is probably not the answer that you wanted, but it is the answer. You need to declare a custom ControlTemplate for the Slider control. This is no task for a new developer really, but there is some help at hand. First, I recommend that you read through the WPF Control Templates - An Overview page on MSDN for some background to this task.
Next, if you're not put off by that read, you can find the default ControlTemplate for the Slider in the Slider Styles and Templates page on MSDN. It's always best to start with the default ControlTemplate and to get that working before you make any changes to it. From there, you should just make small changes and run your project regularly to ensure that your changes are what you wanted. You'll get there in the end.

How to fit Windows Form to any screen resolution in c#? [duplicate]

This question already has answers here:
Best way to make Windows Forms forms resizable
(2 answers)
Closed 9 years ago.
I work on VS 2010 with C#. Even thought i set window state to maximum some panels of the form are not fit to screen when changing the resolution. How to solve this problem ?
This doesn't happen automatically. In order to get child controls to change their size with the parent form, you have to set some properties. Specifically, look at the Anchor and Dock properties.
Lots of questions about this already here. I can't do better than Simon's explanation.
As #Cody stated, Anchor and Dock can solve a lot of layout needs. For more complicated layouts, however, you may want to look at utilizing the TableLayoutPanel().

injecting text to process without injecting dll [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is there a way to overlay an application over a full-screened program?
Is it possible in C# to inject a text to process (like fraps for example), but without using any .dll injections?
Thanks in advance for responses.
#update
"A text" means some fast refreshing labels or something, which will show informations e.g.:
Name:Test
Pos: x=123,y=456,z=0
Level: Unknown
Something.....
You can use automation to send keyboard actions and suchlike to another program. Otherwise if there is no exposed API then things look bleak. See this question for an overview on the methods you use to send keystrokes.
EDIT: What you're asking for is not injection, it's an overlay. What you're looking to do is take control of the display buffer so that your overlay always has a higher z-index than whatever is being rendered. Take a look at this answer

Create form bound to object [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
XAML Binding Properties
I was wondering how in WPF do you bind an object to a form, etc have all its properties linked to fields on the form?
Look at MVVM pattern.
This is a very good video I found very helpful to understand the topic for myself
MVVM Pattern explained
You need to go and read some tutorials on DataBinding.
Bing search : xaml + binding
But seriously http://msdn.microsoft.com/en-us/library/ms748857.aspx this is a good one from msdn wpf binding section

Categories