25,058 questions with .NET-related tags

Sort by: Updated
6 answers

Listbox add item makes logic not work

I have a listbox that has 3 items at design time, my logic works, but if I add a button that adds 100 items at run time it does NOT. I am trying to switch the color of the selection to a different colors with a case statement. public int caseSwitch {…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-09T08:22:24.59+00:00
LexiCodes 1 Reputation point
commented 2020-04-17T07:30:20.603+00:00
Peter Fleischer (former MVP) 19,316 Reputation points
2 answers

WPF IValueconverter is Not Firing When Click the radio button

Here is my xaml below. The DisplayUnitConverter is not firing when I click the radio buttons. Can someone assist me to see what I am doing wrong? I have initialize the Element name in the SpinEdit control to the Radio Control name. <Window…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-15T12:10:29.503+00:00
pianoboy11 1 Reputation point
answered 2020-04-16T07:12:54.537+00:00
Peter Fleischer (former MVP) 19,316 Reputation points
1 answer

how to customize charts in WPF? (using System.Windows.Controls.DataVisualization.Charting)

i am working on LineSeries Chart . i want to have following customizations 1) the Box in which legends are shown i wan to remove it , as i have single series i dont want legends and box. in my case an empty box is there. please refer the image 2) how…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-15T20:55:15.187+00:00
Aniket Khot 1 Reputation point
answered 2020-04-16T03:25:26.737+00:00
Alex Li-MSFT 1,096 Reputation points
1 answer One of the answers was accepted by the question author.

Wondering if sharing a Shared Project between different solutions, is the wrong approach?

Some days ago I asked in this forum How to use a SharedProject between different solutions? And @Anonymous answered it (thanks again, Alex!) But now I'm wondering if that's the wrong approach. Unless I'm misunderstanding the answer, it seems to me that…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-09T21:01:55.473+00:00
Rod At Work 866 Reputation points
accepted 2020-04-15T15:42:16.313+00:00
Rod At Work 866 Reputation points
1 answer

How to maintain two slightly different XAML for two projects?

I have two projects in my hands that are used in different scenarios. There are many XAML pages in these two projects, and some of page in one project is copied from another project(old version) and modified namespace, added some new things. Now I am…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-15T06:56:14.587+00:00
Flithor 196 Reputation points
answered 2020-04-15T15:35:54.31+00:00
Rod At Work 866 Reputation points
1 answer

How to set the Highlight brush to random color

I have this code below that sets the color to random, how to set the selected Listbox item to random?? private void button_Click(object sender, RoutedEventArgs e) { Brush brush = new SolidColorBrush(Color.FromRgb((byte)r.Next(1, 255), …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-08T22:40:09.633+00:00
LexiCodes 1 Reputation point
commented 2020-04-15T06:36:38.597+00:00
Alex Li-MSFT 1,096 Reputation points
1 answer

WPF - Auto width for FlowDocument's content

Hello, I'm having a hard time trying to make a RichTextBox's content in my app auto-sized. Specifically, I want the content inside my RichTextBox to be of automatic width (with a MaxWidth boundary), and Wrap when the width exceeds the available space. …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-13T14:07:26.567+00:00
Nicolás Bosi 1 Reputation point
answered 2020-04-15T06:26:27.137+00:00
Alex Li-MSFT 1,096 Reputation points
3 answers

im using word Inetrop in a WPF C# App Which i find a word and Change its color to red and im facing issues

This is my Code it works but I have a problem at the third part when I try to change the word 'No' color to red it changes any word that includes 'No' for example 'Not Isolated' was Effected by this and its color was changed how can i specify that i…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-08T01:23:51.503+00:00
IProfileTNo 1 Reputation point
answered 2020-04-15T01:33:15.183+00:00
Alex Li-MSFT 1,096 Reputation points
0 answers

Reg: Clear previously logged-in users list from OneDrive login screen

Hi Team, We have developed a WPF application, where multiple users can log in to our application. We are using WPF web browser control to load the one drive login page. Our requirement is to not show the previously logged users' information on the…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-06T05:33:55.607+00:00
Chakradhar Y 1 Reputation point
commented 2020-04-14T09:31:06.883+00:00
Alex Li-MSFT 1,096 Reputation points
1 answer

How to increase WPF 3D Performance?

I have a problem looking forward to your suggestions about WPF 3D performance. It runs quite well with a small width and length, but with a width and length of about 949x825 When measured by stopwatch, all of the implementation in c# code only takes…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-10T04:58:49.733+00:00
Dragon 81 Reputation points
commented 2020-04-13T07:57:02.457+00:00
Dragon 81 Reputation points
1 answer One of the answers was accepted by the question author.

Why this error when doing an image conversion

I am trying to convert a BitmapImage to a Byte() with the following code: Dim ic As New ImageConverter Dim bts() As Byte = DirectCast(ic.ConvertTo(clsImage, GetType(Byte())), Byte()) The error message I get is: > Unable to cast object of type…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-12T14:11:16.517+00:00
RogerSchlueter-7899 1,261 Reputation points
accepted 2020-04-12T20:57:39.707+00:00
RogerSchlueter-7899 1,261 Reputation points
2 answers One of the answers was accepted by the question author.

Can't Get My Image to Appear in an Image Container

I have all the parts to display an image in the wpf Image control but I cant' get them all wired together. First I have a Picture class as follows ((ignoring irrelevant code): Public Class Picture .... Private _Image As Byte() Private _Title As String…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-03T16:04:42.707+00:00
RogerSchlueter-7899 1,261 Reputation points
accepted 2020-04-12T17:15:24.51+00:00
RogerSchlueter-7899 1,261 Reputation points
1 answer

XAML > Binding SelectedValue to a concatenation of 2 properties

Hi, I've a Person class public class Person { public string location; public string name; ... } ...and a list of Person List<Person> list1 = new List<Person>() { new Person() { location = "Chicago", name =…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-12T08:04:22.117+00:00
JM Deb 1 Reputation point
answered 2020-04-12T09:15:55.863+00:00
Peter Fleischer (former MVP) 19,316 Reputation points
3 answers One of the answers was accepted by the question author.

Toggle Button Color Bound Property Not Concistant

Can't get my color property's bind logic right. I get odd color behavior and occasionally the toggle switch switches back on its own. Can anybody help Thanks Madaxe <UserControl x:Class="WpfApp5.ToggleButtonUserControl" …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-09T19:37:23.907+00:00
Marc Jeeves 386 Reputation points
answered 2020-04-10T16:44:44.11+00:00
Marc Jeeves 386 Reputation points
1 answer One of the answers was accepted by the question author.

DocumentViewer "PART_FindToolBarHost" - change default language

Hi, I would like to use DocumentViewer for print preview of my XPS files. However, the ContentPresenter control known as PART_FindToolBarHost embedded inside DocumentViewer doesn't recognize my Windows language settings, so by default It's everything…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-08T17:13:09.45+00:00
Luka Ciglar 21 Reputation points
commented 2020-04-09T23:49:55.893+00:00
gekka 8,141 Reputation points MVP
1 answer

C# WPF user Control Binding Problem

I'm building a simple user control toggle switch, I'm using the margin to move the Ellipse once the user selects with the left mouse button. I want the usage to bind to a boolean to make it simple. The control works when i put it in a datagrid but…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-09T16:45:47.1+00:00
Marc Jeeves 386 Reputation points
answered 2020-04-09T18:39:43.037+00:00
Marc Jeeves 386 Reputation points
4 answers One of the answers was accepted by the question author.

[WPF] XAML how to inherit lists?

Hello everyone! I have a structure class MyContainer { List<MyItem> Items; } class MyItem { string Name; int Value; } I want to get instances of Containers whic have values from the base => mean broadcast values to other containers…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-08T20:58:35.07+00:00
FireFenix 21 Reputation points
accepted 2020-04-09T18:27:11.79+00:00
FireFenix 21 Reputation points
2 answers One of the answers was accepted by the question author.

How to use a SharedProject between different solutions?

I've been working on a SharedProject for our various WPF apps that we're writing. There's some common, general (and sometimes generic) code that we've been sharing between different projects, by using the good ol' tried-and-true copy-and-paste. I've…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-07T22:19:55.93+00:00
Rod At Work 866 Reputation points
accepted 2020-04-08T15:00:39.903+00:00
Rod At Work 866 Reputation points
0 answers

Does webview support webauthn(FIDO2.0)?

WPF app with webview tested with https://demo.yubico.com. But it shows browser not supported. At the same time, the edge browser works fine. On checking the user agent of WPF app and Edge below difference found. WPF WebView User Agent: …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-04-03T08:45:20.007+00:00
Vishnu Gopalakrishnan 126 Reputation points
commented 2020-04-08T07:30:16.983+00:00
Charles He-MSFT 96 Reputation points Microsoft Employee
1 answer

[WPF] Some paths was disappeared when scale canvas

When I add many Paths on canvas and zoom out canvas, some paths was disappeared. I execute on Window 10, 64 bit and .Net 4.7 Please let me know, why some paths was disappeared and solution for this issue. Thank you so much!

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,716 questions
asked 2020-03-31T02:13:32.99+00:00
Trần Bảo Dũng 1 Reputation point
commented 2020-04-07T08:40:31.047+00:00
Alex Li-MSFT 1,096 Reputation points