Posts by Mathi901 • 1,295 points
22 posts
-
1
votes0
answers269
viewsQ: How to link image on canvas with an object
I have the following class: class Sapo { private Image imgSapo; public int IdSapo { get; } public Sapo(int id) { imgSapo = new Image(); IdSapo = id; } public Image show { get { imgSapo.Source = new…
-
0
votes1
answer81
viewsQ: How to keep scrolling always at the end of the WPF textbox
How can I always keep the scroll at the end of the textbox? I have a textbox, but it receives a lot of content, and when it arrives at the end it does not follow and text that exceeds, is always in…
-
2
votes1
answer8466
viewsQ: Find item in a List with Contains method
I have a Data object, which has the attributes name(string) and transactBlock(int). I have a Data List called dataBlock. I want to see if this list has an item already with the same name and…
-
2
votes0
answers205
viewsQ: List overwriting items
I have a Data Object List, which has two attributes: Name (String) and Transactylock (Int) It’s the Data List However, with each execution of the executarSchedule method, it overwrites the item…
-
21
votes2
answers10649
viewsA: Check if a word is within a sentence
You can use the method Contains(). string frase = "Eu sou criativo"; string palavra = "criativo"; if(frase.Contains(palavra)) { faça algo; }…
-
4
votes2
answers9037
viewsA: CPF mask in the textbox?
You will have to use String.Format. In your case, you just need to take the contents of your Textbox and change the format: long CPF = Convert.ToInt64(txt.Text); string CPFFormatado =…
-
-1
votes5
answers1153
viewsA: If the image is large vertically, height: 100%, if it is large horizontally, width: 100%?
In your css define the style as follows: <style> img{ width:auto; height:auto; } </style>
-
0
votes1
answer234
viewsQ: Disable button when selecting item in Datagrid
I have a datagrid with records and an edit button. At the moment I am doing the following: the user selects the Datagrid item and clicks the Edit button, to then be performed the verification…
-
1
votes2
answers10665
viewsQ: How to get time difference between two Datetime variables in C#
I have two variables DateTime, which are Datacadastro and DataAtual(DateTime.Now). I need to know if the time difference between these two dates is greater than or equal to 4 hours. Is there any…
-
2
votes2
answers675
views -
4
votes1
answer310
views -
2
votes1
answer122
viewsQ: Tie problem for
I’m having a problem and I can’t identify it in my code, I have a for with 60 iterations, and it’s falling in if’s when I identify it (i in this case) is divisible by 5 or 3 only in the first…
-
6
votes1
answer217
viewsQ: What is behind the malloc() dynamic allocation function?
What mechanisms the function malloc() uses in practice to manage dynamic memory allocation in a program?
-
1
votes1
answer3328
viewsQ: Concatenate string with integer
I have a variable that is a char vector, and in this vector I need to insert a number that is an integer, searching it for another variable: int quantidade; char id[3] = 'p'; For example, if the…
-
2
votes1
answer132
viewsQ: Char count in C
I have a C function that should take a string, and pointers that have the amount of numbers and vowels that are present in the string, but the function is not adding up each time it finds a number…
-
1
votes3
answers264
viewsQ: Pointer return error in function
Guys, I’m making the following mistake: incompatible types when assigning to type 'char [30] ' from type 'char *' the code is as follows:: int main() { char *resultado[30]; float valor = 12735.98;…
-
1
votes1
answer2935
viewsQ: Sort Char vector in C using selection method
I am trying to sort a char vector using the selection method (Seletion Sort), but it is returning me the vector exactly the same way, without even making a change. Can someone point me to the error…
-
1
votes2
answers19198
viewsQ: Script /.bat to kill certain process on all users logged in to the computer
Well, folks, my problem is this: I have a process called gdc.exe. If a user has this process open and another user logs into the machine and tries to run the program that generates this same…
-
0
votes1
answer2145
viewsA: How to limit characters in a textbox
It’s quite simple: in Xaml add: MaxLength="500" and in code c#: NomeDoTextBox.MaxLength = 500; If you have many textbox you can create a variable with this value: public const int TamMaxCaracteres =…
-
12
votes2
answers13989
viewsQ: What is the function of the super in a Java constructor?
I have a daughter class that inherits from another abstract class, and in the class builder I have the following: Public aluno(String nome, int idade){ super(nome,idade); } What is the function of…
-
0
votes1
answer1332
viewsQ: WPF application. How to reference the image in the XAML code, so that another user can view it when running . exe project file?
I’m having a problem with my WPF application. I have two images in XAML code, and when I run the application on my computer, they appear normal, but when I ask someone to run the file. exe , it runs…
-
50
votes1
answer5366
viewsQ: What is the meaning of the operator "?"
I was looking at some codes and I came across the operator ??: static int? GetNullableInt() { return null; } int y = x ?? -1; What is the difference between the first code and the second?…