Questions tagged as '.net'

2
answers

Error: Not all code paths return a value

The following is the error:    "CustomerLogon (string, string)": Not all code paths   return a value class Conta { #region atributos public String nomeCliente { get; set; } public String numAgencia { get; se...
asked by 12.07.2017 / 01:20
2
answers

How can I change the appearance of the form according to the operating system?

When I develop a project in C # (Windows Form Application) the appearance of the application window (borders) is according to the OS in which I'm running the application (Windows XP, Vista, 7, 8, 10)! WINDOWS XP WINDOWS7 How would I...
asked by 10.04.2018 / 02:30
2
answers

How to change button color using RGB or Hexadecimal code?

I have a WinForms application and would like to use colors that are not in the default settings of the Color object, how could I do that? For example: How the code is: this.btnLogout.BackColor = System.Drawing.Color.Red; Example o...
asked by 08.04.2018 / 23:43
3
answers

How to remove the first item from an array without for or foreach

How to remove the first item from a non-foreach array. I have tried this, but it says that there is no remove or removeAt method. int[] arr = {1,2,3,4,5}; var removeu = Array.Remove(arr,0);//Agora percebi que isso é javascript, rs This...
asked by 06.07.2015 / 22:57
1
answer

Is it possible to change the template / graphical interface of a form in Windows Forms?

I've been researching about and the results I've achieved have been only to use WPF instead of using WinForm, but I'm still in doubt and I believe it's possible, is it possible to change the software template developed in Windows Forms?     
asked by 19.11.2014 / 13:39
1
answer

How to stop printing positions = 0 of a vector?

In the example below, how would I stop printing the positions of this vector that are equal to 0 int[] caluculo = {50,6,0,59,6,7,0,6,8}; for(int i = 0 ; i < 9 ; i++) { Console.WriteLine("{0}",calculo[i]); }     
asked by 24.02.2018 / 15:16
3
answers

Error traversing vector

The user pastes the values that will be saved into the vector and then displays those values. However the following error is occurring:   An unhandled exception of type 'System.IndexOutOfRangeException' occurred in vetoor.exe ". My code l...
asked by 04.01.2017 / 22:01
2
answers

Voice recognition does not work

Recently I formatted my notebook and had to reinstall everything, but now my TCC project is in error, which I did not have before. In this code snippet: SpeechRecognitionEngine sre = new SpeechRecognitionEngine(new CultureInfo("pt-BR"));...
asked by 22.05.2016 / 18:07
1
answer

Check data before using as array element

In chat was asked something about data entry validation to avoid catch error out of range allowed. I found the question interesting and pity that was not posted here, I am posting: public static T[] ReplaceRange<T>(this T[]input, T[] r...
asked by 13.07.2018 / 17:29
2
answers

Return last record from table

I'm trying to make a method that returns the last record of the table but gives error:    "Coditem" operation failed public int UltimoItem() { con = conexao.obterConexao(); try { cmd = new SqlComm...
asked by 04.10.2017 / 21:48