Questions tagged as 'c#'

1
answer

How to display a Messagebox when selecting an item in the combobox

I would like to know how to implement in my combobox a Messagebox when selecting an item from the list? Example: Combo List: Junior Maria Joseph When you select Mary, a message box will appear stating: You have sel...
asked by 01.12.2017 / 14:12
2
answers

Why is DirectoryInfo.Exists true after deleting the directory?

In the following code var Directory_02 = "TEST_01"; DirectoryInfo directory2 = new DirectoryInfo(Directory_02); directory2.Create(); if (directory2.Exists) { System.Console.WriteLine("{0} exists: {1}", Directory_02, directory2.Exists);...
asked by 29.11.2017 / 02:21
1
answer

How to exit a method before ending in C #

What should I do to stop running a method before it finishes, quits, and continues execution? public void MEUMETODO() { ... PARA E SAIR AQUI(); ... }     
asked by 21.05.2015 / 18:11
3
answers

How do multiple projects have the same post-build event?

I have a Visual Studio solution with 277 projects. And I would like everyone to have the same post-compilation event. Basically, they would run an executable that is in the application folder. Anyone have any suggestions?     
asked by 06.04.2015 / 20:14
3
answers

Sort the children in query Linq

I'm having trouble in ordering a query where I have to sort the children by the ID, Follow Source. public Grid GetByOrderGridData(long id) { var query = from c in context.Set<Grid>() where c.Id == id o...
asked by 28.06.2017 / 14:48
2
answers

Converting word file to pdf

Is there a free library that I can convert word file to pdf? I have word file saved database with type varbinary(MAX) and I retrieve it as byte[] in C # and I want to convert word to pdf to show in HTML page. I show on the HT...
asked by 19.07.2018 / 20:08
1
answer

Why is it not recommended to use the event in C # project with WPF and MVVM?

I'm very new to WPF I'm doing a project using MVVM and Entity Framework and it was suggested not having any Click tails event for a button in the code behind a window, for what reason? What is the alternative to replace the below event without b...
asked by 04.09.2017 / 23:15
2
answers

When consuming a service, error occurs in fields float or double in the BD

When I use the update service, this error occurs:    The 'DataLib' property on 'Release' could not be set to   'System.Double' value. You must set this property to a non-null value   of type 'System.Single' This error happens when [Rout...
asked by 14.09.2017 / 20:45
1
answer

Conditional "on" and "off" on a button C #

As a secondary function on a button or element? For example: private void Bnt1_Click(object sender, EventArgs e) { } private void Bnt2_Click(object sender, EventArgs e) { bnt.Enabled = false; } In this code, when you click Bnt2 the...
asked by 24.05.2017 / 12:11
2
answers

Changing Cell Color according to condition in IF in C # WPF source code

I have a DataGrid in a form in C # WPF, how can I execute a method retrieve each cell contained in that DataGrid and assign a possible value, or change the background color? For example I have a DataGrid: [ A ] [ D ] [ C ] [ C ] [ B ] [ A ]...
asked by 29.05.2017 / 13:17