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
-
19
votes4
answers1648
viewsHow to create a user interface with the same style that was used in Visual Studio, Office 2013, Github for Windows, etc?
I would like to know how to create UI as used by Visual Studio, Office 2013, Github for Windows, etc. I searched the internet and found a theme for WPF called Cosmopolitan Theme, but noting some…
-
13
votes2
answers505
viewsIs it possible to program using the Winrt API without resorting to XAML?
Some time ago declarative languages took over the development of software for creating graphical user interfaces. The most obvious examples are the framework WPF that uses XAML (Extensible…
-
11
votes1
answer286
viewsWPF form is going behind all windows when a Combobox is selected
My form WPF works perfectly, but in a ComboBox specific, after the action of selecting, the form is going behind all the windows, without further explanation, and this does not happen in any other…
-
9
votes1
answer585
viewsWhat are namespaces in XML?
Well, I understand the concept of namespaces in C#, C++, etc. But I don’t understand the concept of namespaces in WPF (XAML). I’ve been trying to understand the parameters xmlns in a XAML code. I…
-
8
votes3
answers7123
viewsDisable windows form maximize and minimize
I need a solution to disable the maximize and minimize buttons of a windows form. Using WPF these two attributes would solve: WindowStartupLocation="CenterScreen" ResizeMode="NoResize" But now I…
-
8
votes1
answer355
viewsCentralize (use only one) a Try-catch for every WPF application
Is there any way to centralize a try-catch for every application in a WPF application with C#? I created a window to use as MessageBox customized. When there is an error in any system registration…
-
7
votes2
answers2252
viewsSelecting a value from a Listview row/column populated by LINQ to SQL
Through the double click event I need to pull a value from a row/column in a Listvview populated by LINQ to SQL. For example, when the user needs to select a value from a row/column of this…
-
7
votes2
answers355
viewsHow to use Windows Forms components in a WPF application?
Is there any way to use Windows Forms components in WPF? For example, I need to use control Chart or the MaskedTextBox from Windows Forms, which does not exist in WPF applications, as I could use it…
-
6
votes2
answers4042
viewsGet property values of a class
I have the following codes: private PropertyInfo[] ObterPropriedades(Type classe) { PropertyInfo[] properties = classe.GetProperties(); return properties; } private string[]…
-
6
votes1
answer283
viewsHow to edit data (just numbers) and calculate their values on a Datagrid?
I need a Datagrid column to receive from users only numbers in rows (cells) and that after clicking the button, multiplication calculations are performed between cells of the same row and different…
-
5
votes1
answer839
viewsWPF - The Selecteditem property, from Combobox, is not working properly
Note: This question was the translation adapted from the original question, so all the Updates of the original question are together in this text, sorry for that, but the time is short and I can’t…
-
5
votes3
answers266
viewsWPF - Datagrid - Exclusion
How can I get the index of a selected item on my Datagrid in WPF? I know in WEB Forms I can get it like this: MainGrid.Rows[e.RowIndex].Cells[0].Text
-
5
votes1
answer129
viewsMultiple component events in one method
I have several events of my textbox, the problem is that I have about 30 in my form. I wonder if there is any way for me to improve my code, reduce it by creating only one method to control all…
-
5
votes1
answer1818
viewsHow to make a placeholder in a Textbox?
How can I simulate a placeholder using WPF? Something like the input HTML where you click in the field it adds the text and when you change it returns the text? Remembering that it is in WPF,…
-
5
votes2
answers111
viewsControl order causes "System.Nullreferenceexception"
I’m doing some initial tests with the WPF and I came up with this question. Make no mistake: <DockPanel Margin="5"> <TextBox x:Name="myTextBox" DockPanel.Dock="Right" Width="50" />…
-
5
votes2
answers651
viewsDifference is between Backgroundworker and Task.Run()?
Usually when I had to do some operation on background, mainly involving progress bar update or Labels I used to use the BackgroundWorker, with your events WorkerReportsProgressand DoWork. I recently…
-
5
votes2
answers203
viewsDocumentation on WPF with pure C# code
WPF is what’s "new" for development, not only desktop but also mobile. However, almost all material that is available on WPF is fully tied to the use of IDE and XAML. But XAML is an intermediate…
-
5
votes2
answers131
viewsMysql DATE type is displayed as DATETIME on a datagrid
I create a very simple database with the following command: CREATE TABLE IF NOT EXISTS `ABC`.`Socio` ( `idSocio` INT NOT NULL, `SocioNome` VARCHAR(45) NULL, `SocioDataNasc` DATE NULL, PRIMARY KEY…
-
5
votes1
answer280
viewsHow to make the properties of a User Control accessible in XAML?
A User Control can be used for various purposes, but I would specifically like to know a simple example of how to create a User Control any that returns any value. For example a Numericupdown:…
-
5
votes2
answers133
viewsPrintdocument Printpageeventargs c# wpf Pagesize WPF
I have the following code: PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(arquivoImpressao); pd.DefaultPageSettings.PaperSize = new PaperSize("teste", 300, 600);…
-
4
votes3
answers335
viewsLayout Messagebox WPF
How can I customize my Messagebox? Original.. How I’d like it to be (Greater)…
-
4
votes2
answers2456
viewsEnd a C# process with WPF
I have a solution that has two projects. a main project and another that serves as Updater. To perform the upgrade, within the main project, I call a console application as follows. private void…
-
4
votes1
answer101
viewsIsmouseover does not work
I have a boot in WPF and changed the style when passing the mouse on top (Ismouseover), but the problem is that not every time I move the mouse on top it changes style. When step the mouse very fast…
-
4
votes0
answers120
viewsFailure in WPF stylization
I have a problem with references of a style within the code. I have a DLL of several stylized components inherited from the Telerik package with only a few changes like color, size, etc... Within…
-
4
votes2
answers325
viewsKnow if the application has been completed by the task manager
There’s no way my app knows it’s being terminated by the task manager? If the user is going to finish my application by task manager, my application detects this completion and performs some tasks…
-
4
votes1
answer201
viewsPick up selected Radiobuttons in WPF
I have several radiobuttons on my form, each with a content different. How do I catch the radiobuttom selected? Without having to do a método to check one by one.…
-
4
votes1
answer310
viewsHow to go through all the controls of a WPF window?
Is there any way I can go through all the controls of a window and disable them? For example, do a foreach that disables one by one of the controls. Something like below, only for WPF, and not…
-
4
votes1
answer193
viewsEntity Framework 6 tries to insert FK
I have a small application in C#, WPF and EF6. I’m using Code First, but I’m having a hard time creating a relationship. Look at my code, of the classes I want to relate: I’m editing for the final…
-
4
votes1
answer61
viewsPartial for separation of events and methods
I saw in a system a separation of methods in a partial and the events in another in UserControl and Window as the example below: "Pessoa.xaml.cs" public partial class Pessoa: UserControl {…
-
4
votes1
answer402
viewsUpdating a collection object’s values via Binding WPF, MVVM
Following MVVM model, I am not able to update the values of a variable of an object in a collection, show them on the screen or the user type and this value be passed to the variable. In my case, I…
-
4
votes1
answer1123
viewsWhat is the function called to drag the window to the corners of the screen?
How is called the function of clicking and dragging the title bar of the window to the corners of the screen, and they auto adjust? Example: when you drag the window in the right corner of the…
-
4
votes0
answers197
viewsc# outlook Sendeventhandler opening object only once
In my application I use Outlook Sendeventhandler to capture the click on the "Send" button of the email in outlook and open a screen to register observation regarding the email that was sent. I have…
-
4
votes1
answer95
viewsWorking with Sources C#?
I added the Dictionary Source to my project, now I need to convert it into a code dictionary, but it is bringing the null resource, someone can help me? List<string> dic = new…
-
4
votes1
answer2182
viewsThe call thread cannot access this object because it belongs to a different thread
Follows the code: private async void button_1_Click(object sender, RoutedEventArgs e) { var listenPort = 11000; var listener = new TcpSocketListener(); listener.ConnectionReceived += async (senders,…
-
4
votes1
answer267
viewsAccept only one comma in Textbox c# WPF
Hello I have my decimal textbox like this: <TextBox x:Name="TextBox" KeyDown="TextBox_KeyDown" Style="{StaticResource MeuTextBoxValor}" Height="23" Margin="1" Text="{Binding Peso,…
-
4
votes1
answer172
views -
3
votes1
answer149
viewsHow to exchange the text of a cell of a table that is inside a Flowdocument that is in a Richtextbox
I am trying the following code to replace the text in the question situation, where rtb is the richtextbox, .Document is the flowdocument. The text is exchanged in Run (r), but when I open the…
-
3
votes1
answer537
viewsCan I fill a Datagrid with a List<T>?
How do I fill one DataGrid from a List typical? It would be possible to generate the columns automatically?
-
3
votes2
answers2290
viewsCan I use the same WPF view for Desktop and Web?
Dear ones, I have never programmed with WPF but soon I will have the opportunity and already thinking about the future, which is now, in which desktop applications will be/are being migrated to the…
-
3
votes1
answer445
viewsWhat’s the best way to sync desktop app data with webapi?
I have my desktop application that needs to send data (just send) to a webapi, this data cannot be sent repeatedly and also after sent, not send again, the desktop app will be on. net(wpf) the…
-
3
votes1
answer54
viewsEmbedded font with compound name is not displayed
I am embedding some fonts in my WPF application but some are not displayed. Fonts are in the /Fonts folder at the application root and their properties are set to Resource. Use like this:…
-
3
votes1
answer422
viewsWPF window does not exceed the screen
I have the following code: System.Windows.Point ponto = PointToScreen(Mouse.GetPosition(this)); JanelaAbrir.Left = ponto.X; JanelaAbrir.Top = ponto.Y; JanelaAbrir.ShowDialog(); It opens the Window…
-
3
votes1
answer935
viewsDatabase query for a C#List
I need to make a query at the bank, I made this code for connection, but I do not know how to proceed to put this information in a list<String> SqlConnection conexao = new…
-
3
votes1
answer1363
viewsHow to load Datatable on a Datagrid?
I have a DataTable loaded with information in a WPF application. I’d like to take that DataTable and carry it on a DataGrid. How can I do this the easy way ? DataGrid in the XAML: <Grid>…
-
3
votes2
answers479
viewsAdding checkbox to datagrid lines
I have an application in WPF, where there is a window with a datagrid with multiple lines, having only records. In this window there is also a button and I need the user, when clicking the button,…
-
3
votes1
answer369
viewsFirst letter of menu underlined for shortcut - WPF
I am trying to put a shortcut on my system menu in WPF. In Windows form, just change the text property by putting the "&" before, but in WPF does not use "text" but "content" Somebody help me?…
-
3
votes1
answer164
viewsWhere to make the connection to the database?
In the MVVM pattern where I must connect to the database, in View, Model or Viewmodel?
-
3
votes1
answer433
viewsHow to use a theme in wpf?
I’m trying to use a package of WPF themes, but I can’t call it, when I use it says it lacks the reference and I can’t find any tutorial or anything current about it. I tried to install using nuget…
-
3
votes3
answers903
viewsHow to apply String formatting in Datagrid - WPF
I have a Data Grid in WPF that has columns of CPF, RG, CEP and others, I need to do the formatting for: CPF: 111.111.111-11 RG: 11.111.111-1 With number at the end RG: 11.111.111-A With letter at…
wpfasked 9 years, 6 months ago Mauricio Ferraz 2,074 -
3
votes3
answers727
views