Questions tagged as 'wpf'

3
answers

ListBox selection

Every time you move an item up or down a listBox it loses the focus of the item. I can not always focus on the item. For example: suppose my list has 200 items. So I want to move the item that is in position 160 to the 159, so once...
asked by 27.07.2017 / 15:19
2
answers

What are the differences between Visibility.Hidden and Visibility.Collapsed?

What are the differences between WPF visibility% wp% and wpf%? There are practical or theoretical differences between set the Visibility.Hidden and Visibility.Collapsed of a control for zero and set its visibility to H...
asked by 10.09.2016 / 03:41
2
answers

MySQL DATE type is shown as DATETIME in 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 ('idSocio')) ENGINE = InnoD...
asked by 09.11.2016 / 22:31
2
answers

Define date and time format used by DateTime

I have an application where it has record time, which uses DateTime.Now , and a start date and end date that the user informs. Showing this data in a DataGrid is in MM/dd/yyyy hh:mm tt format. I want it to be shown in the Bra...
asked by 09.09.2015 / 18:35
1
answer

Why is it not recommended to use the event in C # project with WPF and MVVM?

I'm very new to WPF I'm doing a project using MVVM and Entity Framework and it was suggested not having any Click tails event for a button in the code behind a window, for what reason? What is the alternative to replace the below event without b...
asked by 04.09.2017 / 23:15
2
answers

Changing Cell Color according to condition in IF in C # WPF source code

I have a DataGrid in a form in C # WPF, how can I execute a method retrieve each cell contained in that DataGrid and assign a possible value, or change the background color? For example I have a DataGrid: [ A ] [ D ] [ C ] [ C ] [ B ] [ A ]...
asked by 29.05.2017 / 13:17
1
answer

UserControl, what is it? When to use?

I am studying how to best control users in a WPF application, but I have some doubts about UserControl available in VS 2015. I have already programmed an access control, ie user and login , user registration and etc., but now I need t...
asked by 08.08.2016 / 20:08
1
answer

Calculate square root in C #

I have a calculator made in WPF C # with the basic operations +, -, *, /,%. And now I wanted to try to improve my calculator. namespace calculadora { public delegate float? dlgoperacao(float? a, float? b); public partial class MainWindow :...
asked by 23.06.2016 / 13:29
3
answers

Is there any way to dynamically add attribute to instantiated object in C #?

Well, in C # we put attributes as follows: [Required("Este campo é obrigatório")] public string Nome {get; set;} What I would like to know is whether there is a way to dynamically add attributes to instantiated objects. Like the following h...
asked by 26.05.2018 / 17:04
2
answers

WPF C # String Format

I have a usercontrol with the following configuration: <UserControl x:Class="PainelPendencias.View.PendenciaConsulta" x:Name="uCPendenciaConsulta" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"...
asked by 20.12.2016 / 14:48