Questions tagged as 'c#'

1
answer

Packages do not restore NugetPackage

After upgrading VS2017 to version 15.5.1 this project no longer restores the packages I tried to remove the packages and install again but did not work, I reinstalled VS did not work well, I researched a little and had some solutions to...
asked by 14.12.2017 / 17:56
2
answers

Why can not I call object cta1 instantiated in btnCriarConta_Click?

Why can not I call object cta1 instantiated in btnCriarConta_Click ? namespace proj3 { public partial class conta : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void...
asked by 15.12.2017 / 16:57
2
answers

How to center layout

I want to center this panel, even when the screen is maximized, I want it to stay centered. And not as it is.     
asked by 08.12.2017 / 12:24
1
answer

Reading txt with StreamReader

When reading a TXT file, from accounting postings exporting by a third-party system, my problem is in the lines that have the number.    VLR REF SIT ANYTHING N ° 1834 MORE TEXT Using the class StreamReader as follows using (var r...
asked by 05.12.2017 / 12:38
1
answer

How to check if the line has been broken?

I use File.ReadAllText to read the text inside a .txt file. private void label9_TextChanged(object sender, EventArgs e) { string text = File.ReadAllText($@"{pathname}", Encoding.UTF8); if (text.Length) // Como fazer aqui...
asked by 05.12.2017 / 00:19
1
answer

View PDF document windows forms

Is there any property of viewing a .PDF file from the Click event in PictureBox without having to create a new modal? Example: I have this PictureBox , where I created the code below, that as soon as it is clicked the option to print...
asked by 04.01.2018 / 18:52
1
answer

How to move a window using a button? W#

I have a WPF application that has no borders or background, it's just a stylized button with an image and a frame, but I wish it were possible to move it. My current code looks like this: <Button Name="button" Margin="10,130.475,377.541...
asked by 06.01.2018 / 00:00
1
answer

Service being loaded null in the controller

When I make a post for my controller, when debugging, I saw that the service which I load in my constructor, is coming null type. Controller: public class UserController : ApiController { private static IUserService _userService; p...
asked by 20.02.2018 / 20:01
1
answer

System.ArgumentException: 'Invalid parameter.'

I created a button with button24_Click_1 to take printscreen of Form1: private void button24_Click_1(object sender, EventArgs e) { var frm = new Form1(); using (var bmp = new Bitmap(frm.Width, frm.Height)) { frm.Draw...
asked by 02.12.2017 / 20:24
1
answer

Doubt - Design on the secondary screen and Form

The following event code click: //Estendido telaSecundaria = new SegundaTela(); Screen[] telas = Screen.AllScreens; Rectangle bounds = telas[1].Bounds; // pode ser outro índice. telaSecundaria.SetBounds(bounds.X, bounds.Y, bounds.Width, bounds...
asked by 02.12.2017 / 18:06