Most voted "wpf" questions
Windows Presentation Foundation, or WPF, is a subsystem for presenting user interfaces in Windows-based applications. It features a diverse set of controls, layout options, 2D and 3D graphics, media and text manipulation and allows data binding and model-oriented style.
Learn more…413 questions
Sort by count of
-
0
votes1
answer48
viewsMainwindow changes size by itself when running the application
Greetings! I created a small XAML window in a WPF project where in Design view is perfect, but when I run the application in Debug mode the window changes in size on its own. What to do so that the…
-
0
votes0
answers106
viewsCreating properties in all WPF windows
Anyone has any idea if it is possible to inherit from the WPF Window class, create some properties and when creating my screens instead of making them inherit from Window make them inherit from this…
-
0
votes1
answer89
viewsDeclare textbox event in XAML
How do I declare the Keypresseventargs event from a textbox to work with this event in Code Behind? The code to run the event I have, I just can’t declare the event, as I do with Click, for example.…
-
0
votes1
answer215
viewsWPF C# datagrid create multiple column header
I’m dynamically creating columns for a datagrid, but I need to create headers as below, some hint on how to do using c#? --------------------------------------------- | Person 1 | Person 2 | |…
-
0
votes1
answer251
viewsLoad list with Entity
The following. I created a context class inherited from DbContext. public class SiloContext : DbContext { public SiloContext() : base("inetConn") { } public DbSet<Produto> Produtos { get; set;…
-
0
votes1
answer41
viewsDifferent layout on the last datagrid line
I have a datagrid where I show values referring to the beginning and end of a period. For this, I created the columntemplate down with 2 textblocks, but in the last line, I show a value that is the…
-
0
votes1
answer178
viewsWPF C# Outlook Mailitem insert image in email body
I am using the code below and can insert an image into the body of the email. How would you add more images? Is it necessary to create multiple "imageCid"? The code below only shows the last image.…
-
0
votes0
answers76
viewsProblems changing line color of a Datagrid in C# Wpf
I am having problems changing the color of the Datagrid lines, I use the following function int i = 0; private void gvDados_LoadingRow(object sender, DataGridRowEventArgs e) { DataGridRow rowContext…
-
0
votes0
answers49
viewsHow to Reverse an animation (run it in reverse) via pure shampoo
I did an animation Storyboard Abram menuzin and so far so good, I’ve done it before reverting the animation by c# //pode estar errado mas foi mais ou menos isso sb =…
-
0
votes0
answers60
viewsGenerate a new control for each listed item
Hello, based on the code below, I would like to know how to generate a new control( in my case a grid) for each existing item in my Listbox... My Listbox: <ListBox Height="380.585"…
-
0
votes0
answers143
viewsHow to update textbox from another WPF window
I have 2 windows wpf (C#) To register B search engine provider Inside the window A to a textbox and a button that opens the window B, Inside the window B has a textbox and a button. How do I move to…
-
0
votes1
answer162
viewsHow to use Drawtobitmap in WPF to take screen print?
Follows functional code of the WinForms: Bitmap pic = new Bitmap(label1.Width, label1.Height); Rectangle rect = new Rectangle(0, 0, label1.Width, label1.Height); rect = label1.ClientRectangle;…
-
0
votes1
answer13
viewserror loading Progressring (Mahapps)
I have a Progressring on a Page in WPF that needs to be displayed while the Grid is being loaded (Goal: Show the user that you are loading) and then be disabled when loading it has been completed.…
-
0
votes1
answer59
viewsProblems Inserting Image on a Button
I’m having trouble inserting an image of the "Packiconfontawesome" package into a button. I installed the Icons package of Mahapps and referenced in my view, only an error appears as the image…
-
0
votes1
answer248
viewsHow to move a window using a button? c#
I have an application in WPF that has no borders or background, it’s just a stylized button with an image and a frame, but I would like it to be possible to move it. My current code is like this:…
-
0
votes0
answers38
viewsException sqlite in windows 8
I’m getting this Exception when trying to open a window inside a program I made, the program was done in visual studio 2017, with sqlite 3, it opens normal only from this problem when trying to open…
-
0
votes1
answer90
viewsError Entity Framework WPF Client
I installed my application in client environment but am getting the following error: Nome do Evento de Problema: CLR20r3 Assinatura do Problema 01: eLogBook.exe Assinatura do Problema 02: 1.0.0.0…
-
0
votes1
answer39
viewsProblems with hotkey to open and hide the interface using "Application.Current" (C# WPF)
The following code works without problem I made it based on the code available on the internet of Sirmestre, however it only opens/closes the Mainwindow UI, I have tried some things to work but…
-
0
votes1
answer160
viewsHow to resize the font size - WPF?
The following code works with winforms: while (label1.Width < System.Windows.Forms.TextRenderer.MeasureText(label1.Text, new Font(label1.Font.FontFamily, label1.Font.Size,…
-
0
votes1
answer433
viewsWPF select all Datagrid Checkbox
Hello, I’m trying to select all Checkbox of a datagrid but I’m not succeeding. Below is my code to select: private void CheckUnCheckAll(object sender, RoutedEventArgs e) { CheckBox chkSelectAll =…
-
0
votes1
answer182
viewsDoubt WPF C# - Setfocus on a Text and leave a button disabled
I’m having difficulty in c# because when I click a button, it has to disable a button and leave the Focus in a txt. But I don’t know how to reference an object in wpf (xaml) in the encoding file…
-
0
votes1
answer170
viewsChange Button name via WPF code?
I’m looking to access a control in WPF to access the properties of it and modify. However, I can’t find much approach to Wpf currently. What I want to do, for example, is change the name of a button…
-
0
votes2
answers156
viewsProblem adding C#images
I’m trying to create an object like Image from an existing image, which will be inserted into a Frame and which in turn will be inserted into a Stackpanel. However, only images/icons that are…
-
0
votes1
answer59
viewsWPF - Access Usercontrol of a selected Tabitem
I own a Tabcontrol with several Tabitems, that I have separated the contents into Usercontrols to organize the code. But they all have a Textbox in common of which I want to get the value on a…
-
0
votes0
answers25
viewsError while restoring Windows Forms Application Database
I am creating the database backup but cannot restore. It shows the following error: this is my code to perform bank restore to my application. try { var _with1 = openFileDialog1; _with1.Filter =…
-
0
votes0
answers99
viewsProblem updating object properties with data Binding
I’m trying to update the properties of an object every time a character is added/removed from the textboxes but I’m not getting... I read several topics about databinding and everything seems to be…
-
0
votes1
answer161
viewsError connecting to database using Entity Framework
I am creating a WPF application, and decided to use the Entityframework to perform operations in my bank. I created a data model from an existing database in my Mysql Workbench, and the process was…
-
0
votes0
answers30
viewsHow to ensure password security when extracting a Securestring in C# WPF
I was reading about Securestring and what she can offer. However, I am in a scenario where I have a Passwordbox and I want to extract the password of this component, encode it in hash and then…
-
0
votes1
answer295
viewsC# flow chart/organisation chart component
I am making a desktop application for product configuration, having as selection fields various options related to them, eg: model, voltage, application... where when selecting each one, the other…
-
0
votes0
answers117
viewsProject with MVVM architecture
I’m having some doubts regarding the MVVM architecture. I am developing a project that has the following characteristics: - Main form with dynamic content - Main form generates some tabs according…
-
0
votes2
answers186
viewsPrevent the user from using the mainwindow window while another window is open
I have a WPF application following the MVVM standard and in a certain part of the application I show a Progressbar that I implemented in a separate view for the user and, while this progressionBar…
-
0
votes0
answers27
viewsHow to separate style sheets using Xamarin Forms
Hello, I am coming from WPF where it is possible to create my style files in separate files and from the same use in my UserControl's the same style settings. I did some (many) searches and found…
-
0
votes0
answers55
viewsTextbox.Selectall() works when going through the keyboard, when simulo no
Good staff, I have a way for 3 Textbox to run when they win Focus: private void NumericKeyboardTextBox_GotFocus(object sender, RoutedEventArgs e) { e.Handled = true; this.textBoxForNumeric = sender…
-
0
votes1
answer101
viewsBind problem in C# WPF
I have a WPF that is as follows: <ComboBox Name="comboBoxRemetente" VerticalContentAlignment="Center" Margin="5" Grid.ColumnSpan="20" ItemsSource ="{Binding Path=Lista, Mode = TwoWay}"…
-
0
votes1
answer38
viewsMouse move over an item and an event be generated WPF
I’m having difficulty implementing an effect where when I hover over the item on the screen the speed should be 0. And without the mouse above should be back to 30. Use WPF using MVVM structure, so…
-
0
votes1
answer30
viewsC# wpf Datagrid generation
I have a datagrid that is automatically generated dgPagamentos.ItemsSource = HistoricoDoClienteViewModel.ExibirPagamentosPorCliente(id); My problem is that this call returns me an object that…
-
0
votes2
answers80
viewsProgress bar does not update with ftp download
Hello, so here’s the thing i have a function that downloads the desired file from http, and as it downloads, it updates the progress bar (being increased from 0% little to 100% when finished).…
-
0
votes0
answers2051
viewsCustom userControl events still running in the code in the visual studio, is that a bug?
I am developing in WPF, and while doing a custom userControl, I had a surprise, when I went to use the Events "Routedeventhandler Loaded" and "Routedeventhandler Unloaded" of…
-
0
votes1
answer50
viewsDifficulty with Clickonce c# Wpf
I have an application and recently I had to implement the Webdriver Phantonjs, which simulates a browser but in a way that is invisible to the user. In my application everything is ok, it works…
-
0
votes1
answer39
viewsGet x:Name of control by clicking
Hello, I have a stackpanel with a sequence of Abels and would like to capture the x:Name of the controller in the Label Mouseup event. XAML: <StackPanel Background="#FF405089"…
-
0
votes0
answers19
viewsChange the background color based on a Boolean Binding and Setting to Different color Binding WPF
I need to change the background color according to a toggle button. I got the toogle based on: TRUE: I want to apply Binding to a user-defined default color stored in the variable made Binding.…
-
0
votes1
answer119
viewsEffect of fading Windows window to (Minimize, Maximize and Close)
I left the WindowStyle="None" and that eliminates all the animation of the window. A normal window edged has the excitement of fading to the (minimize, maximize and close). I wish that same effect…
-
0
votes1
answer95
viewsHow to add an icon inside a Textbox using Material Design?
I installed the Material Design Xaml package in my project, but I have a question of how to create an icon in Textbox. I have the following code: <StackPanel> <TextBox…
-
0
votes0
answers12
viewsHow to access the properties of a class that is within another class?
I have this custom control: public class CustomButton : Button { public Test Test { get; set; } } And this class: public class Teste { public string MyProperty { get; set; } } I want to change this…
-
0
votes1
answer21
viewsBinding of an Image in the Preject Resource
Good morning, you guys. I’m making a weather app for the course I’m doing and the weather icons we pull direct from links on the internet. How I would do it locally? The Icon is specified by an int…
-
0
votes0
answers25
viewsBest Way to Implement Inotifypropertychanged
The traditional way would be to create a class where implements INotifyPropertyChanged and then inherit where you use it: public class NotifyPropertyChange : INotifyPropertyChanged { public event…
-
0
votes0
answers43
viewsI Can’t Create Bitmapimage "interface that was marshalled for a Different thread"
Error: System.Exception: 'The application called an interface that was marshalled for a Different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))' I’m trying to get a BitmapImage…
-
0
votes0
answers15
viewsCommand only works if you edit the code while the program is running
Xaml <ItemsControl ItemsSource="{Binding Foldres}" FontSize="14" Foreground="{StaticResource SecondaryTextColorSolidColorBrush}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"…
-
0
votes0
answers17
viewsClose Window when Thread finishes c# wpf xaml
How do I close the Window after the thread runs ? This error is given: System.Invalidoperationexception: 'The call thread cannot access this object because it belongs to a different thread.'…
-
-1
votes1
answer273
viewsCreate side menu like Windows 10 Weather App
The friends who accompany me here, they must have read one previous question I did with that same theme. But as I mentioned in my last comment there, I gave up the initial idea because I concluded…