Posts by SUR1C4T3 • 571 points
32 posts
-
0
votes1
answer32
viewsQ: Calling method by string command
I am a command bar in an application with several functions present in buttons in a Ribon. A large part of these functions must be able to be executed by means of commands, for example: Botão…
-
0
votes0
answers8
viewsQ: Option "Web Package Management" VS 2017
I’m trying to add this menu, but I can’t find where. My VS meets like this:…
-
2
votes0
answers240
viewsQ: Insert picture text into a Sharepoint Listitem
I create items in Sharepoint, with a WPF/C#app, as in the example: using System; using Microsoft.SharePoint.Client; using SP = Microsoft.SharePoint.Client; namespace…
-
0
votes2
answers246
viewsA: Get "Version Name" [Xamarin.Forms]
You can use Versiontrack. using Xamarin.Essentials; VersionTracking.Track(); After starting Track, you can read the version information. Down with the methods: // First time ever launched…
-
1
votes1
answer512
viewsA: Menu Icon change color by hovering over WPF c#
You can use the events MouseEnter and MouseLeave. The MouseEnter is executed the moment you place the cursor over the element (Hover). The MouseLeave is executed when the cursor exits the element.…
-
4
votes1
answer5505
viewsQ: What is starvation (starvation)?
Some conditions may prevent progress in the execution of processes or threads, two of these conditions are called dead-lock and live-lock, where what I extracted from information was that, dead-lock…
-
1
votes4
answers4102
views -
4
votes1
answer106
viewsA: c# - Error trying to Replace a string
Follows below solution: string teste = System.IO.File.ReadAllText("c:\\arquivo.txt"); teste = teste.Replace("id=\"KP", "id=\"KPC"); Note: The file .txt contained your HTML.…
-
9
votes5
answers1894
viewsQ: Test for string fill
When reading a post on good programming practices, more related to validating the filling of strings, I came across the following: Very slow check: string ret = String.Empty; if…
-
-2
votes1
answer94
viewsQ: Return object between screens - c#
I have a question about returning an object from a screen B to a screen A, for example. I use the form below, hiding the ShowDialog of the base class, making the "new Showdialog" return what I need.…
-
0
votes3
answers218
viewsA: Public field X property
The public allows you to access this variable, or even other classes, methods, etc, through other classes. For example, if you have a variable defined as private, you will not be able to access it…
-
0
votes2
answers48
viewsA: Conversion error in the array of a . csv file to a datatable
Using a check with tryParse it is possible to check this before error: while (true) { string[] lineItems = line.Split(';'); if (int.TryParse(lineItems[1], out int result)) { //So entrará aqui se o…
-
5
votes2
answers64
viewsQ: Is expression-bodied recommended? Is there a performance difference?
The extent to which it is recommended, or even good practice to use Expression-bodied? I know that the Expression-bodied allow properties, methods, operators and other function members to have…
-
0
votes1
answer328
viewsA: Download . txt to memory and read
If I understand correctly you want to know how to write and read a txt, it is time to read separate by ",". I will leave an example here, see if it suits you. Escrever Txt: IList<string> lista…
-
0
votes1
answer267
viewsA: How to disable the textchanged event in the load event in Visual Studio C#?
There are two ways you can solve at first. The first, and simplest, is to set this text in the Textbox on the screen itself, in the component’s text property, not needing to do this in the Load…
-
2
votes0
answers40
viewsQ: Difference between String and String in C#
Following example: String teste = "teste"; string teste2 = "teste2"; What is the guideline for using each of the forms?
-
-1
votes1
answer130
viewsA: C# problem with MAIN and source
From what I noticed your class is not inside a namespace. The right thing would be: namespace WpfApp1 { public class MinhaClasse { static void main(string[] args){ } } }…
-
2
votes1
answer89
viewsA: Change Color of Datagrid
One possibility is to have a property on the object you are listing to do this: public virtual int BackgroundId { get; set; } In the click event you can change the value of this variable to…
-
-1
votes1
answer52
viewsA: Selectionbrush property with only edge and no padding
You can set the edge properties in the textbox itself: <TextBox x:Name="TbTeste" BorderThickness="2" BorderBrush="Red"/>
-
0
votes1
answer295
viewsQ: C# flow chart/organisation chart component
I am making a desktop application for product configuration, having as selection fields various options related to them, eg: model, voltage, application... where when selecting each one, the other…
-
1
votes2
answers885
viewsA: Send email via c#
It follows a way of sending emails. The login and password you use to log in to your account is used as credentials. try { var smtp = new SmtpClient { Host = "smtp_aqui", Port = 587, EnableSsl =…
-
0
votes3
answers1275
viewsA: Changing pictures from a Picturebox C# - Windows Form Aplication
You should have a list of all the image paths in the directory you selected. something like: DirectoryInfo directoryInfo = new DirectoryInfo("DiretorioAqui"); List<string> imagens =…
-
0
votes3
answers160
viewsA: Use string to reference variable
To obtain the value of a variable of some object it is possible to do as follows: Imagine an object named "Test" with 2 properties (Description and Name). Let’s say I want to take the value of some…
-
0
votes2
answers464
viewsA: How to sound (beep)? - Xamarin Forms
In the System.Media namespace has a class called Systemsounds, which contains methods to perform the main sounds associated with Windows (Beep, Asterisk, Question, Exclamation and Hand). So just use…
xamarin-formsanswered SUR1C4T3 571 -
1
votes1
answer24
viewsA: Is it possible to have a 'Partialview' in WPF?
As a system of tabs in wpf there is Tabcontrol, where inside there can be n Tabitem, which are the tabs themselves. Ex: <Window x:Class="WpfApp1.MainWindow"…
-
0
votes1
answer93
viewsA: Sort by Reflection with Getproperty
You’ve tried it this way? _Getall(). Orderbydescending(x => Convert.Toint32(x.Gettype().Getproperty("Id").Getvalue(x, null).Tostring()). Tolist(); Here it sorts objects by Id in a decreasing way.…
-
1
votes1
answer85
viewsA: How to fill a scrollview with equal grids dynamically?
If you search for this list from a bank and want to build the screen dynamically, you can build it by code. Just with a stackpanel created on your screen, loop each item in the list and create a…
-
2
votes1
answer109
viewsA: How to equally divide Stackpanel’s space between children
The stackpanel would not be very usual in this case, I recommend you use a grid and set the columns of it distributing the buttons in each of the columns. <Grid Height="35">…
-
3
votes1
answer137
viewsA: UML - Class Diagram
You should analyze not by the classes you create in your program, but by what the classes will manipulate, remembering that the objects are different from the classes: An object needs a class to…
-
0
votes1
answer447
viewsA: System.Runtime.Interopservices.Comexception (0x800A175D) error
I’ve had this problem, basically Interop uses the feature installed on the computer that is running, and probably this error pc does not have word installed, which is necessary for the type of…
visual-studio-2015answered SUR1C4T3 571 -
0
votes4
answers653
viewsA: Cross values in array
I don’t know php, but the logic behind it is simple. One of the possible ways to do this is, within a repeating structure have a sum variable (e.g., sum), whose goal is to match the intended value…
-
0
votes1
answer62
viewsA: How to synchronize full screen and minimized c#
From what I understand, your doubt is to have 2 screens (or more) side by side at the time you are making the design of the same. Well, if it is just drag the tab of the document you are editing,…