Search results for query: *

  1. glasswizzard

    Question How do I bind in this manner? Multi-binding?

    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...
  2. glasswizzard

    Question Why did this for loop run forever?

    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...
  3. glasswizzard

    Question How do I upgrade to C# 8?

    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...
  4. glasswizzard

    Resolved Opening Context Menu Causes Content to Uncheck

    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...
  5. glasswizzard

    Question How to bind a window's size to an image's size?

    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...
  6. glasswizzard

    Question Trying to drag the window

    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...
  7. glasswizzard

    Answered Is there a control that's like a HTML table?

    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?
  8. glasswizzard

    Question ComboBox's MaxDropDownHeight Property Isn't Working

    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"...
  9. glasswizzard

    Question Can FallbackValue be used for an image's Source property?

    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...
  10. glasswizzard

    Question Dynamically Creating Textblocks and Grids

    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...
  11. glasswizzard

    Resolved How do you easily choose from many methods?

    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
  12. glasswizzard

    How do you search through a datatable?

    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...
  13. glasswizzard

    Resolved What's the best way to handle a lot of text?

    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...
  14. glasswizzard

    Question Can a wrap panels children be aligned with each other?

    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...
  15. glasswizzard

    Question I'm failing to bind a brush to the foreground property of a textblock

    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"))...
  16. glasswizzard

    Question Inheritance: What am I doing wrong?

    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...
  17. glasswizzard

    Resolved Why don't these two gridsplitters do anything?

    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...
  18. glasswizzard

    Question Is it possible for this form to be recreated using only a grid panel?

    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?
  19. glasswizzard

    Question Does C# contain methods that calculate number properties?

    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.
  20. glasswizzard

    Question A Bizarre Problem is Suddenly Occurring

    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...
Back
Top Bottom