Here is an image to help clarify my question.
Three TextBoxes and a TextBlock. I want the TextBlock to be bound to one TextBox and mirror it's contents, but, if I mouse over another TextBox the binding will change so the TextBlock mirrors the Text of that TextBox instead. Mousing over a...
Here is a problem I have just solved, but I'd like to know why it happened in the first place. Here is a console program from the web that populates a list of prime numbers:
using System;
using System.Collections.Generic;
namespace PrimeFactorCalculator
{
/// <summary>
/// This program...
I figured you just download the latest VS and that's it, you've got the latest version of C#, but today I got an error when trying to set a property to readonly, saying "Feature 'readonly members' is not availble in C# 7.3. Please use language version 8.0 or greater."
So it seems I'm using...
I made a context menu on a window with three items that are checkable in the menu, the top one is checked by default. When I right click on the window the menu opens but the top menu item is clicked, causing it to uncheck.
I have the IsChecked attributes of the menuitems binded to properties in...
I have two windows, one of which is solely to display an image. The image is determined in the other window. I have all the functionality done except one thing, I can't figure out how to make the window's size always match the image in it's viewbox.
The window in question contains one grid (one...
Hi, I managed to get this working in winforms a while back but I'm failing to do it in WPF. I want to click and drag on a specific TextBlock in order to drag the window. Here is the code I've tried (I don't really know what I'm doing):
private void ProfileTextBlock_MouseDown(object sender...
The datagrid uses headers and it has it's own background etc so it's not quite what I'm looking for. Is there a control that lets me draw a simple grid and fill it like a HTML table?
So I hear that the length of the comboBox's drop down list can be changed with the MaxDropDownHeight property. Unfortunarly for me it does nothing at all, maybe I'm using the wrong property? Here is the code relating to the ComboBox:
<ComboBox x:Name="ProfileComboBox" Width="Auto"...
I'm trying to get this line of code to work:
<Image x:Name="ViewBoxImage" Source="{Binding ViewBoxImageSource, FallbackValue=../Resources/Images/ViewBoxImageName.png}"/>
That would be inside a viewbox. I don't know if FallbackValue doesn't work with an image source or if I'm typing it out...
This might seem pointless but I'd like to know if this is possible and practice doing it.
I want to type into a text box and have the text mirrored onto the form, say below the textbox. I don't want to bind a textblock to a string property even though that will do exactly as I just described. I...
I need to write a method that will call one of many other methods, I know I could write a huge switch statement to get to the right call but is there an easier way?
I have a string that could be used to get the name of the method to call if that's any help.
Thanks
Could someone give me a rundown on how to search through a datatable looking for matching data please. I made this image of a simple table:
I forgot to add column headers but lets say the headers are the letters A, B, C, and D. When I execute the search I want the numbers to be examined and...
Well, not exactly a lot, more like a small paragraph, maybe two. I've been looking at the flowdocument to build up the text data (dynamically created as user uses the app) then show it in a FlowDocumentScrollViewer, but flow documents do a lot I don't need, I just want to display the text. Is...
I have a wrappanel with several labels the user can enable or disable (collapse or make visible). When it wraps around, the labels on the second row aren't aligned with the labels above (because they aren't the same length).
Is there a way to get them to align with each other, so their centers...
So I made a class called MyBrushes (stored in a folder called "Classes"). So far it looks like this:
using System.Windows.Media;
namespace WpfApp1.Classes
{
public class MyBrushes
{
public Brush Brush1 = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00BA00"))...
I must be misunderstanding inheritance because I want to do a simple thing but it doesn't work. Let's say I have a base class like so:
public class BaseClass
{
int num1 = 0;
int num2 = 0;
int num3 = 0;
public BaseClass(int a, int b, int c)
{
num1 = a;
num2...
Below is the XAML for the form that I recreated using just a grid, I added two gridsplitters to it (at the bottom) but they don't seem to actually do anything, I can't resize the grid with them. Is it because I've set specific sizes for the grid and it won't change from them?
<Window...
A book I'm reading suggests trying to recreate the above form using only a grid, so I guess it is possible, but the layout just doesn't look like a grid at all. I don't understand how you would define rows and columns to make something that isn't laid out like a grid. Is it possible?
Does C# have methods that will tell me about certain properties of numbers?
I'd like to know four things about a number, if it's prime (if so what prime number), if its triangular (if so what triangular number), if it's square (and what square it is) and also the same for the Fibonacci sequence.
Hello, could someone help me with this perplexing problem that has suddenly decided to screw with me, I honestly have no clue how this happened, as far as I know I did nothing at all to cause this, it seems to me like Visual Studio is broken but I did repair it and the problem persists...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.