Posts by gtpt • 479 points
35 posts
-
0
votes1
answer24
viewsA: How to insert Dynamic Grid into the WPF XAML interface
After all it was simple ... public MainWindow() { InitializeComponent(); myGrid.Children.Clear(); myGrid.Children.Add(createMyGrid(3,4)); } ... but the function was changed so: private Grid…
-
-1
votes1
answer24
viewsQ: How to insert Dynamic Grid into the WPF XAML interface
I wrote a method that creates a Grid dynamically: private void createMyGrid(int l, int c) { //Create grid Grid DynamicGrid = new Grid(); DynamicGrid.ShowGridLines = true; //Create lines for(int i=0;…
-
1
votes1
answer171
viewsQ: How to format all the Labels of a form with a style associated with an id?
I had this example initially: css #label1 { color: #FFFFFF; text-align:left; font-style: italic; } html ... <table> <tr> <td><label for="nome1" id="label1">Jogador…
-
0
votes0
answers116
viewsQ: Std::Begin and Std::end iterators in the circular list context
The Std::list class creates a circular list. When I create an iterator to go through it I come across an ambiguous situation, which I exemplify: #include<iostream> #include<list> using…
-
0
votes1
answer203
viewsQ: Apply transition effect when changing the source of an Image control
I have a button to which is associated an image loaded from a Resourcedictionary. In XAML I carry them like this: <Button x:Name="selecao" Grid.Row="1" Grid.Column="2" Margin="10"…
-
0
votes1
answer38
viewsQ: Switching between [Page Class] pages in an application
I’m looking up examples of browsing between pages in a desktop application. Let’s assume that the navigation is done from a Listbox always visible in Ui. Most examples do something like this to…
-
0
votes2
answers750
viewsQ: Read a BLOB corresponding to an image
The following code uses the Mysqldatareader to obtain a database-specific record: string cmd = string.Format("Select * from socios.socio WHERE idSocio={0}", chave); MySqlCommand comandoMySQL = new…
-
0
votes1
answer39
viewsQ: Is there a class in c#(WPF) equivalent to Qt’s Qsignalmapper?
When I was learning C++/Qt I used a very interesting class that allowed me to associate several interface buttons to a single event that, upon a value by which each button was mapped, allowed me to…
-
0
votes2
answers67
viewsA: Save an image by identifying it from Frameworkelement
I have however abandoned this approach and solved so in a simpler way: //Criar um ficheiro no disco correspondente à imagem exibida na área de preview private void…
-
0
votes1
answer24
viewsA: Save the image associated with an Image control to disk
This was the solution found by me: private void guardarImagemDiscoDoPreviewButton_Click(object sender, RoutedEventArgs e) { //Save As Dialog ... Microsoft.Win32.SaveFileDialog dlg = new…
-
0
votes2
answers67
viewsQ: Save an image by identifying it from Frameworkelement
I have this layout: <StackPanel> <Button x:Name="button" Content="Button" Click="button_Click" Height="50" /> <Image x:Name="image" Source="vermelho.jpg" /> </StackPanel> The…
-
0
votes1
answer24
viewsQ: Save the image associated with an Image control to disk
Let’s assume an image is loaded for control Image of the following example ... <Button x:Name="button" Content="Button" /> <Image x:Name="image" /> What code is required to associate to…
-
0
votes1
answer237
viewsQ: Upload Datagrid Image to Image
Variable x is associated with an image (blob field) that I loaded into a Datagrid from a Mysql database. DataRowView selectedRecord = (DataRowView)dataGridImagem.SelectedItem; var x=…
-
0
votes1
answer49
viewsA: Transfer image from one Image control to another of the same type
Arghh ... I can’t believe it was that simple: imagem02.Source = imagem01.Source;
-
0
votes1
answer49
viewsQ: Transfer image from one Image control to another of the same type
I have these three controls: <Button x:Name="btn" /> <Image x:Name="imagem01" /> <Image x:Name="imagem02" /> Suppose I carry an image on "imagem01" using: OpenFileDialog ofdImage =…
-
0
votes1
answer401
viewsA: Load Combobox from a Mysql table - Manipulate key and other field
Of the solutions I found this seemed the simplest. Just changing the event handler: private void selecaoComboBox_DropDownClosed(object sender, System.EventArgs e) { if (selecaoComboBox.SelectedIndex…
-
1
votes1
answer401
views -
1
votes1
answer65
viewsA: Programmatically change the date displayed in a "Datepicker" control?
I resolved so: DateTime selectedDate; DataRowView selectedRecord = (DataRowView)dataGridProdutos.SelectedItem; ... selectedDate = (DateTime)selectedRecord.Row.ItemArray[2];…
-
1
votes1
answer65
viewsQ: Programmatically change the date displayed in a "Datepicker" control?
I’m trying to display data from a table field MySQL in a control DatePicker. The code is as follows:: if (dataGridProdutos.SelectedIndex != -1) { DateTime selectedDate; DataRowView selectedRecord =…
-
1
votes2
answers1155
viewsA: Insert text in the header of a spreadsheet from text in a cell
Everything indicates that what I want is not possible without resorting to VBA (link); Apparently you would have to do a macro to fill the section of the respective header. Sub HeaderFromA1()…
-
1
votes2
answers1155
viewsQ: Insert text in the header of a spreadsheet from text in a cell
To configure the header of a spreadsheet I go to Configure Page > Header/Footer > Customize header. Let’s say, in the center section, I want to see a headline that’s in cell A1. How can I do…
-
5
votes2
answers131
views -
0
votes1
answer63
viewsA: Datagrid - Last column enlarges too much
I know what caused this behavior. I had the property Sizetocontent="Widthandheight" in the window. Probably the width of the last column was calculated from the maximum available resolution size!…
-
0
votes1
answer63
viewsQ: Datagrid - Last column enlarges too much
I have a datagrid displaying data from a Mysql database table. If all columns are Width="Auto", when I resize the window the grid does not follow. If I put in the last column Width="*", it works as…
-
1
votes1
answer43
viewsQ: Empty line at the end when I do Data Binding - (WPF Datagrid Control + Mysql)
I have been implementing the example of this link. Basically I have: XAML <Window x:Class="DataGridBind.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"…
-
4
votes1
answer2786
viewsQ: How to format a cell from the RGB code contained in the cell itself
It is possible to change the background color of a cell from a code RGB or hexadecimal written as text in the cell itself? Let’s say I write 255,0,0 in célula A1 and when I press enter cell…
-
3
votes1
answer61
viewsQ: Model/View Programing - WPF and Mysql
I had already made some programs in C++ using the QT framework and its Model/View Programming(http://doc.qt.io/qt-4.8/model-view-programming.html). The concept was simple: created a template that…
-
1
votes2
answers387
viewsA: Find Broadcast address for sending UDP message
I leave my final version of the elementary emitter/receiver. Emitter using System; using System.Net; using System.Net.Sockets; using System.Text; class Program { static void Main(string[] args) {…
-
2
votes2
answers387
viewsQ: Find Broadcast address for sending UDP message
My Wi-Fi network interface contains the following settings: Wireless LAN adapter Wi-Fi: Connection-specific DNS Suffix . : home Link-local IPv6 Address . . . . . : fe80::95d7:bda0:eac3:ebf7%5 IPv4…
-
1
votes1
answer55
viewsQ: Error in namespace when creating "Resource Dictionary ..." inside a folder
In an empty project (test - WPF Application) I test two scenarios. Scenario 1 Right click on the project Add Resource Dictionary ... I get the following: <ResourceDictionary…
-
3
votes1
answer322
viewsQ: Relationship between the "Initializecomponent();" method and the loading of a "Splash Screen"
I added a splash screen to a project in the simplest way, that is, by changing the property Build Action for Splashscreen. Although with very similar visual effects, what really happens when we…
-
1
votes2
answers111
viewsA: Control order causes "System.Nullreferenceexception"
I ended up settling it this way: private void atualizarValores_TextChanged(object sender, TextChangedEventArgs e) { if (!(textBoxProduto == null)) textBoxProduto.Text =…
-
2
votes1
answer344
viewsQ: How to change the source of an image control from a Resourcedictionary
I have the next Resourcedictionary: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"…
-
2
votes1
answer31
viewsQ: How to create a Merged "Resourcedictionaries"
I have a small example where I created an application-level Resource: <Application x:Class="teste1.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"…
-
5
votes2
answers111
viewsQ: Control 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" />…