Questions tagged as 'wpf'

1
answer

WPF - Access UserControl from a selected TabItem

I have a TabControl with several TabItems , which separated the content in UserControls to organize the code. But all of them have a common TextBox of which I want to get the value in a Button in the MainWindow . I'm new to WPF , I'm...
asked by 08.04.2018 / 20:15
1
answer

How 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, label1.Font.Style)).Width) { label1.Font = new Font(l...
asked by 21.02.2018 / 19:40
1
answer

How to reproduce the "overflow: hidden" effect of CSS in WPF?

Hello, I'm new to Windows Presentation Forms (WPF) and I need to know how I can do the overflow: hidden effect we have in CSS. I have the following code snippet: <Border BorderThickness="0" Background="Transparent" CornerRadius="12">...
asked by 13.03.2018 / 12:26
2
answers

Problem when adding images C #

I'm trying to create an object of type Image from an existing image, which will be inserted into a Frame and in turn will be inserted into a > StackPanel . However, only images / icons that are inserted inside the project are displayed in t...
asked by 05.03.2018 / 23:02
2
answers

C # WPF - Access element of another XAML by code

Hello, I have two screens a Window and a Page loaded inside the screen Class Window1{ //to do .. __mainFrame; // acessa normal } Class page1{ //to do __mainFrame; // sem acesso ao frame } Inside the window class I have a <Fram...
asked by 22.01.2018 / 19:45
1
answer

How to move a window using a button? W#

I have a WPF application that has no borders or background, it's just a stylized button with an image and a frame, but I wish it were possible to move it. My current code looks like this: <Button Name="button" Margin="10,130.475,377.541...
asked by 06.01.2018 / 00:00
1
answer

WPF C # Doubt - SetFocus in a Text and leave a button disabled

I am having difficulty in C # because when I click on a button, it has to disable a button and leave the focus in a txt. But I do not know how to reference an object in wpf (xaml) in the encoding file (cs) private void View(object param...
asked by 28.02.2018 / 13:25
1
answer

In savechages says column is null and has value

When I call my method to write, the whole object comes filled, but when the savechanges () is called it says IdBalance is null and yet it has the value of 1. Insert method: public virtual void Inserir(T item) { contexto.Se...
asked by 17.08.2017 / 17:02
1
answer

Upload 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...
asked by 11.08.2017 / 16:53
2
answers

Permanent focus on a field - WPF

I have an application with several fields, but I would like to focus only on a specific one and not allow it to be withdrawn in any situation. Always focus focus on this field, and if the user tries to pull it off, it blocks and does not allow t...
asked by 12.06.2017 / 18:19