Questions tagged as 'c#'

3
answers

How to put music in console application with C #

I'm creating a game in C # (console application) and need to put a background music, how do I?     
asked by 01.11.2016 / 21:59
2
answers

Visual Studio 2015 says "this" is redundant

In the early days of my first object-oriented classes I was taught to use this whenever it is a variable or class property. Today I understand when there is a real need to use, for example when a parameter is received in the method tha...
asked by 09.11.2016 / 14:50
1
answer

When should I use if without keys? [duplicate]

I usually use with keys because until today I do not know what exactly the operation of if without keys is and if the else can also be without keys. Is there any variation of behavior between javascript and C #? And among other languages? S...
asked by 29.03.2016 / 18:20
2
answers

How to do sort with LINQ with one LISTT inside another?

Apparently easy but I'm not able to do a LINQ that orders two LISTs that are nested. I do not know if the word "nested" is correct. How can I do this sorting through LINQ, in the code below I show where I want to do LINQ. Current Result...
asked by 25.11.2016 / 16:55
1
answer

Single instance of Class C #

I have a Windows Form with the following code: public partial class frmCadastroPessoaFisica : Form { public frmCadastroPessoaFisica() { InitializeComponent(); } } I would like to create only one instance of this form....
asked by 15.07.2016 / 14:14
2
answers

Saving file path in MySQL

I'm having difficulty saving file address to the database. When saving the address to the bank it is adding the amount of times I used OpenFileDialog to save a file. Save the address always so C:\Users\phili\Desktop\PDF_SGIM_QUALIDA...
asked by 21.06.2016 / 17:34
2
answers

Create a property for a bool variable that treats string and int

I'm creating a project where I look for the database information, in this case it's a DBF file, and the field is a Logical type. However I want to create a property that can receive a variable (either int, string or bool) and write to the privat...
asked by 04.08.2016 / 17:25
2
answers

Override methods based on name only

I'm creating an abstract base class to provide a pattern for other classes. Base class methods must be overridden in the derived class. Now comes the cat's leap. The override should only happen based on the method name, regardless of the p...
asked by 10.07.2016 / 19:23
2
answers

Deleting Items in List

I have a personal: List<Grupos> lista = new List<Grupos>(); And I have this code var matches = lista.FindAll(x => x.Nome_Grupo.ToLower().Contains(txtFiltro.Text)).ToList(); To filter only words from my TxtFilter ,...
asked by 12.05.2016 / 01:22
3
answers

Form waiting for a request

Problem My form makes a requisição determine a database (select, insert, update, delete values), however whenever these requests are made a crash occurs on the form (a freeze)! How do I prevent forms from receiving these crashes rega...
asked by 25.02.2014 / 19:47