Posts by Matheus Miranda • 5,375 points
290 posts
-
1
votes1
answer223
viewsQ: How to clean another Window textbox? - WPF
Follows code: MainWindow mainwindow = new MainWindow(); mainwindow.listbox1.Items.Clear(); // tentativa //mainwindow.listbox1.ItemsSource = null; I try to clean up listbox from another form...…
-
0
votes1
answer119
viewsQ: How to project window2 on the secondary wpf screen?
Following is code (Mainwindow): using System.Windows.Forms; using System.Drawing; var win2 = new SegundaTela(); Screen s2 = Screen.AllScreens[1]; Rectangle r2 = s2.WorkingArea; win2.Top = r2.Top;…
-
3
votes1
answer163
viewsQ: How to return string array of each book with its chapters and verses?
Follows code: var linha = string.Empty; List<List<String>> livros = new List<List<String>>(); string[] filesArray = new…
c#asked Matheus Miranda 5,375 -
0
votes2
answers448
viewsQ: The "Color.Name" property or indexer cannot be assigned, as it is read-only
Follow code where I define SegundaTela: public partial class Form1 : Form { SegundaTela telaSecundaria; } Code: telaSecundaria = new SegundaTela(); telaSecundaria.label_segunda_tela.BackColor.Name =…
-
0
votes1
answer82
viewsQ: How to check if the line was broken?
I use File.ReadAllText to read the text inside a file .txt. private void label9_TextChanged(object sender, EventArgs e) { string text = File.ReadAllText($@"{pathname}", Encoding.UTF8); if…
-
1
votes1
answer967
viewsA: System.Argumentexception: 'Invalid parameter. '
I solved the problem, thanks to the comment of @Manieiro. var frm = new Form1(); Bitmap pic = new Bitmap(frm.Width, frm.Height); Rectangle rect = new Rectangle(); rect = frm.ClientRectangle;…
-
0
votes1
answer967
viewsQ: System.Argumentexception: 'Invalid parameter. '
I created a button with button24_Click_1 to take printscreen from Form1: private void button24_Click_1(object sender, EventArgs e) { var frm = new Form1(); using (var bmp = new Bitmap(frm.Width,…
-
0
votes1
answer43
viewsQ: Doubt - Project to the secondary screen and Form
Follow the event code click: //Estendido telaSecundaria = new SegundaTela(); Screen[] telas = Screen.AllScreens; Rectangle bounds = telas[1].Bounds; // pode ser outro índice.…
-
1
votes1
answer239
viewsQ: How to update listbox from another Form?
Follows code: Class: public class Louvor { public int Value { get; set; } public string Text { get; set; } } Form2: Form1 form = new Form1(); var data = new List<Louvor>(); var files =…
-
0
votes1
answer706
viewsA: Implicit conversion of the nvarchar data type into varbinary(max) is not allowed. Use the CONVERT function to perform this query
The issue has been fixed with the most updated version. Nuget: https://www.nuget.org/packages/Z.EntityFramework.Plus.EF6/…
-
1
votes0
answers740
viewsQ: Access to the path was denied by doing "File.Writealltext"
Follows code: public static string pathname = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory.ToString()) + @"\Arquivo_Principal"; if…
c#asked Matheus Miranda 5,375 -
-2
votes1
answer419
viewsQ: How to return a list of a json?
It follows result: {"response":{"numFound":2654,"start":0,"docs":[{"id":"l3ade68b8g5db3b0b3","langID":1,"url":"/ministerio-codigo-de-honra/quao-grande.html","title":"Quão…
-
1
votes2
answers170
viewsA: How to center panel within groupbox?
Problem solved: panel1.Location = new Point( groupBox1.Width / 2 - panel1.Size.Width / 2, groupBox1.Height / 2 - panel1.Size.Height / 2); panel1.Anchor = AnchorStyles.None;…
-
0
votes2
answers170
viewsQ: How to center panel within groupbox?
How can I center panel1 within groupbox ? Follows code: private void Form1_Load(object sender, EventArgs e) { // aqui defino novo size do panel1 panel1.Size = new Size(591, 423); } The problem is…
-
2
votes1
answer144
viewsQ: Textarea with disable does not break the line automatically
Follows code (with disable): $('#summernote').summernote({ toolbar: false, height: 100, callbacks: { onInit: function() { $('#summernote').summernote('disable'); $('#summernote').summernote('code',…
-
5
votes1
answer147
viewsQ: Error doing UPDATE when setting varbinary variable as`null`
Follows code: var file = Request.Files; var list = new List<byte[]>(); for (int i = 0; i < 4; i++) { if (file.Count > i) { list.Add(ConvertTo.Bytes(file[i])); continue; } list.Add(null);…
-
2
votes1
answer706
viewsQ: Implicit conversion of the nvarchar data type into varbinary(max) is not allowed. Use the CONVERT function to perform this query
Follows code: byte[] image1 = ConvertTo.Bytes(Request.Files[0]); byte[] image2 = null; ctx .Users .Where(x => x.Id == 1) .Update(x => new User() { ImageByte1 = image1, ImageByte2 = image2 });…
-
2
votes1
answer226
viewsQ: Doubt - Winforms on the subject on the second screen
Form1 created panel with black background and label property: Autosize = False Dock = Fill Font size(Size) = 20 And 2 buttons to forward or back letters Form2 only has a black form and a property…
-
1
votes1
answer131
viewsQ: Executesqlcommand - Update byte - Error
Follows code: var bytes = ConvertTo.Bytes(file); int num = ctx.Database.ExecuteSqlCommand( $"UPDATE dbo.Table" + $"SET Video = '{bytes}' " + $"WHERE id = {Id} "); Follow code to convert: public…
-
1
votes2
answers3424
viewsA: How to clean Listbox
You need Items.Clear() to clear the textbox. Example: private void LimparListBox() { //lbxResumo.Text = ""; lbxResumo.Items.Clear(); } private void btnLimparList_Click(object sender, EventArgs e) {…
-
-1
votes1
answer74
viewsQ: How to split an integer number into a string?
String following: 11 blabalba, balbalba balballbal baba 12 balbal13, afafaf14 1414adad1414 I want you to return something like this (separated by split): array 0: 11 array 1: blabalba, balbalba…
c#asked Matheus Miranda 5,375 -
0
votes1
answer3703
viewsQ: How to get the encoding type of a file?
Follows code: string text = File.ReadAllText($@"{pathname}", Encoding.UTF8); I have several txt files with different condition. Because here shows no special characters, because different encoding.…
-
0
votes1
answer161
viewsQ: Showing scrollbar alone with textarea element
Segue Jsfiddle: https://jsfiddle.net/7vaf1th8/15/ Is showing horizontal scroll bar in textarea. Follow the image: Some solution ?…
-
4
votes2
answers170
viewsQ: Doubt - Savechanges does not work, only returns 0
Follows code: using (var db = new Entities()) { var result = db. Tabela1 .Where(x => x.Id == 1) .Select(x => new SuaClasse { Coluna1 = x.Coluna1, }) .FirstOrDefault(); if (result.Coluna1 !=…
c#asked Matheus Miranda 5,375 -
1
votes2
answers138
viewsQ: Tolist() returning read-only
Follows code: using (var db = new Entities()) { var result = db .Tabela1 .Select(x => new { x.Coluna1, x.Coluna2 }) .ToList(); foreach (var item in result) { if (item.Coluna1 == string.Empty) {…
-
1
votes1
answer193
viewsQ: Changing text from another form does not work
Follows code: Form2: public void ChangeLabel(string s) { labelX1.Text = s; } And in Form1: private void button_MostrarSegundaTela_Click(object sender, EventArgs e) { if (Screen.AllScreens.Length…
-
4
votes2
answers400
viewsQ: How do I know if the screen is in "Extend" mode?
I want to make a if to know if the screen is in "Extend". Example: (Win + P) How can I do this in C#: if (?) // só pode entrar no if, se a tela está no modo "Estender". { SegundaTela formulario =…
c#asked Matheus Miranda 5,375 -
1
votes1
answer364
viewsQ: How to get value from a json?
I use WebClient and DownloadString to recover json: using (WebClient wc = new WebClient()) { var teste =…
c#asked Matheus Miranda 5,375 -
0
votes1
answer100
viewsQ: How to return a list of each chapter?
Follows text file: @MATEUS (1) 1 Livro da genealogia de Jesus Cristo, filho de Davi, filho de Abraão. 2 A Abraão nasceu Isaque; a Isaque nasceu Jacó; a Jacó nasceram Judá e seus irmãos; 3 a Judá…
c#asked Matheus Miranda 5,375 -
9
votes4
answers1255
viewsQ: Converting Httppostedfilebase to byte[] : Exception_wasthrown
Follows code: Controller (with post action): var file = Request.Files[0]; var bytes = ConvertTo.Bytes(file); Convertto class : public static byte[] Bytes(HttpPostedFileBase result) { var length =…
-
-3
votes1
answer181
viewsQ: What is it, Xamarin?
It seems that Xamarin is very new. They say that you can develop android or IOS or Windows Phone by C#. That’s right ? For those who are starting now, it’s worth it or not ?
xamarinasked Matheus Miranda 5,375 -
2
votes1
answer444
viewsQ: How to project an image on the big screen?
I’ve looked on the Internet and I can’t find. How do I project an image onto the screen ? Example: On the main screen(notebook) show executable(windows Forms), and on the second screen show an image…
-
2
votes1
answer447
viewsQ: How to split by numbers inside the string?
String following: 1No começo Deus criou os céus e a terra. 2A terra era um vazio, sem nenhum ser vivente, e estava coberta por um mar profundo. A escuridão cobria o mar, e o Espírito de Deus se…
-
2
votes1
answer47
viewsQ: Convert "-12.0000"(string) to -12.0000(double). Is it possible?
It is possible to convert "-12.0000"(string) for -12.0000(double) ? Follows code: var valor = "-12.0000"; var result = Convert.ToDouble(valor, CultureInfo.InvariantCulture); //-12 <--- perde…
c#asked Matheus Miranda 5,375 -
1
votes1
answer130
viewsQ: Hiddenfor - Submit loses value the first time
Follows code: Index: @{ ViewBag.Title = "Home Page"; } <div class="modal fade" id="minhaModal" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-lg"…
-
1
votes0
answers295
viewsQ: Request Not Authorized or Over Querylimit' - Googlelocationservice
Follows code: var locationService = new GoogleLocationService(); var point = locationService.GetLatLongFromAddress("Rua Osasco - Amador Bueno, Itapevi - SP, Brasil"); Error: System.Net.Webexception:…
c#asked Matheus Miranda 5,375 -
8
votes2
answers2446
viewsQ: jQuery - how to change text after "<i>" element?
Follows code: <div class="file-caption-name"> <i class="glyphicon glyphicon-file kv-caption-icon"></i> Alterar texto aqui </div> I’ve tried that way: $('div.file-caption-name…
-
1
votes1
answer328
viewsQ: Scroll bar showing alone
Follows code: HTML: <!-- Button trigger modal --> <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> Launch demo modal </button> <div…
-
1
votes1
answer105
viewsA: How to detect scroll in modal bootstrap?
I found the solution: $('#minhaModal').on('shown.bs.modal', function(e) { $('.modal-body').on('scroll', function() { console.log('scroll y'); }); })
-
0
votes1
answer105
viewsQ: How to detect scroll in modal bootstrap?
Follow my CSS code: .modal-body { max-height: calc(100vh - 210px); overflow-y: auto; } Follows JS code: $('.modal-body').on('scroll', function () { console.log('scroll y'); }); JS code not working,…
-
0
votes2
answers157
viewsA: Limit characters does not work after using Ctrl+ V
After a long time, I found a solution: $(document).ready(function() { var limite = 10; var meuEditor = $('#summernote'); meuEditor.summernote({ toolbar: [ ['style', ['bold', 'italic', 'underline',…
javascriptanswered Matheus Miranda 5,375 -
1
votes2
answers157
viewsQ: Limit characters does not work after using Ctrl+ V
The idea is not to allow typing more than 10 characters. The Crtl + V is failing. Example: Type 9 characters in And then use Crtl + V (fault), it is at this point is allowed to type more than 10…
javascriptasked Matheus Miranda 5,375 -
1
votes0
answers68
viewsQ: Summernote - How to display full screen outside the modal?
I use this plugin: https://summernote.org/ Follow code in jsfiddle: https://jsfiddle.net/9rnj8rdo/ When I click "full screen", it gets full screen inside the modal. I want it to be full screen…
-
0
votes1
answer166
viewsA: Blueimp Gallery inside the Modal with black screen
Problem solved, Putting the following code: $('#exampleModal').on('shown.bs.modal', function(e) { blueimp.Gallery( document.getElementById('links').getElementsByTagName('a'), { container:…
-
1
votes1
answer166
viewsQ: Blueimp Gallery inside the Modal with black screen
Follows code: <!-- Button trigger modal --> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"> Launch demo modal </button> <!-- Modal…
-
6
votes1
answer1588
viewsQ: How to obtain value [[Promisevalue]]?
I’m having trouble getting value [[PromiseValue]] Below is an example of the image in Debugger mode: Follows code: Html: <img id="new_profile_photo" alt="Perfil"> JS:…
javascriptasked Matheus Miranda 5,375 -
1
votes0
answers31
viewsQ: Xmlhttprequest on the main thread is deprecated because of its detrimental effects to the end user’s Experience
I use Signalr library, to send or receive notifications. Follows code: $(function () { // Start hub $.connection.hub.start().done(); // <----Aqui faz ele aparecer no console }); Log console:…
-
0
votes0
answers277
viewsQ: Ilist vs List , main difference
Does anyone know the difference between it ? When should I use IList and List Follows code: Ilist: public ActionResult Upload_Photo(IList<HttpPostedFileBase> file_photo) List: public…
c#asked Matheus Miranda 5,375 -
0
votes1
answer94
viewsQ: The "Mailaddress.Displayname" property or indexer cannot be assigned, as it is read-only
I can already send an email normally. I just can’t change DisplayName. Follows code : var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>"; var…
-
0
votes0
answers39
viewsQ: Visual Studio 2017 v15.3.0 - Bug debugging mode
Follow picture: Follow the image code above: List<string> teste = new List<string>(new string[] { "0", "1", "2", "3", "4" }); I installed the newest version today (15.3.0). Someone who…