1,381 Topics
I am preparing a CSharp based desktop app in VS 2019. I have 4 ComboBoxes. On the form load, the comboBox1 fetches folder names in root directory in D drive. The structure is Folder The sub folder Then sub folder then MS word documents in the 4th folder. For example, …
Hey guys I managed to get some code what works fine but it uses console application I have tried to convert it by hand and change things around to get it to work but with no avail! I'm certain it should be simple but I may be wrong :( Thanks …
I want to determine if the mouse cursor is above a Windows Form and if so, change its color, but I'm kind of new to this and C# also. I was thinking of something like this: public Form1() { InitializeComponent(); if (Control.MousePosition.Y >= 0 && Control.MousePosition.Y <= 499 && Control.MousePosition.X …
Trying to make a game where explosions randomly appear on the screen using visual studio. I figured out how to make a single picture change location on the screen. So, I wanted to make the illusion of an explosion using imagelist. When I try to do it I get an …
Hi, there! Have a question right here. I've been preparing a project (Periodic table of Elements), so user by clicking on elements can access to another form which showing the element properties. Also, the user can search the element based on name, atomic number, year of discovered, and sign. Don't …
Inside of my Windows Form Application , I have a textbox that the user can enter numbers into. I also have an add button if they would like to enter a number and then add another they can hit the button. I'm having trouble with figuring out what you can …
What happens is when the dialog comes up, if I press cancel it opens "c:\\text.txt" How do i make it so that if i press cancel the program reads nothing (it reads "c:\\text.txt" right now) SaveFileDialog [code] private void button38_Click(object sender, EventArgs e) { string l_text; string l_filename = "c:\\text.txt"; …
Hi, I'm getting an exception "Input string was not in a correct format." This happens only when any of the textbox is left empty that means when i click `radioCircle` on the form and only enter `Radius` value and leave all other textboxes empty then i get that error. But …
Dear Friends, I am facing a problem, I have two forms, Form1 Has one DataGrideview and Button redirect to Form2, which has Button(Browse Excel File) and combobox(Sheet No of excel file) and Button to load Excel file list in Datagrideview , **want to show excel file list in Datagrideview of …
So, the title may seem confusing so hopefully I am able to explain myself better via the thread body. I am developing an application for a friend that wants to have a blue light reducing effect for his every day browsing. I have been able to accomplish the task by …
Hi, I am testing a Tcp client C# windows form application I am able to send data to Tcp server Software(Hercules 3.2.8) But when i sent data from Tcp server to windows form then i am getting the following error: System.InvalidOperationException: Cross-Thread operation not valid: Control 'MessageList' accessed from a …
Dear Friends, I facing problem to change color of DGV Row w.e.o Quantity of Remaining days. I tried it but i got error. PLease, check my code. public void RowsColor() { for (int i = 0; i < dataGridView1.Rows.Count; i++) { int val = Int32.Parse(dataGridView1.Rows[i].Cells[5].Value.ToString()); if (val < 14) { …
Hi, I'm developing a windows forms based software that process various '.log' files and provides the output to the user. I've implemented a stop button to stop the processing of the files and when the button is clicked, a message box would display with Yes/No options. The process thread keeps …
Good day! I want to drag 2 panels at the same time during run time, I have 2 panels inside my winform and I made the 2nd panel as the header of the 1st panel.. my problem is when I drag the 2nd panel, the first panel gets left behind.. …
what i have done is copied answer in label and now matching the radiobutton option with it so far so good but i dont know how to uncheck radio button when i get to next question and method of mine stucks in between like sometime it just donot match the …
Previously open programs normally winxp on 32 bit , pass through win7 on 64 bit errors, have you any knowledge of this error ? <html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><title></title><style>.ErrorStyle { font-family: tahoma; font-size: 11 pt; text-align: left}.DetailsStyle { font-family: tahoma; font-size: 10pt; text-align: left;text-indent: 0; word-spacing: 0; line-height: 100%; float: left; …
When designing a form dragging objects (forms) into an edit and delete form, somehow the object on the form is deleted but the code in the form (Form.Designer.cs) does not delete the form. Is there a way to quickly find code not deleted in the above file ?
first I want to say thank you all , You have a stuning Job here. Secondly, I Want to Import Data from Excel File to My DataGrideview columns. I tried but data coms after My added columns.Please, Check my code bellow. private void button8_Click_1(object sender, EventArgs e) { string content …
**Problem** **When split msg variable to more lines it not give me values in lines ? msg variable in debug give me text scanning bellow** **Details** i work in windows form c# vs 2015 i using bar code reader to read qr code bar code scanner working as USB keyboard …
I work in windows form 2015 when i need to read qr code i connect scanner to computer as USB then open my windows form and put cursor in specific text box as textbox4 and it read success so that How to recieve data reading from scanner to textbox4 only …
Hi,' i want the default column header (F1) to be removed and in that place my excel file column "Filename" must come. i am importing data from an excel sheet into my grid then adding another 3 columns and exporting the edited data into excel again. so far i have …
Hello there ! I wrote a dll( using MINGW and Codeblocks ) that should do the "background work" of my app. I have an interface build in Microsoft Visual C++ 2015. Is posible to control some TextBoxes, or Buttons( enable/disable ) or ProgressBars, or opening a new Form from the …
Hi Friends, I have a numbervalidation method that validate phone no textbox. What i need is i have different windows forms, so where can i define this method so that i can access it on different forms globally. Like in VB.NET we have Modules, is their something in C#.NET too. …
Hello Everyone, I have an assignment i am doing and user can select and artist and the amount of tickets per artist but i am unsure how to make it so when i click a seat i can only click the amount of seats i purchased in the previous screen. …
I have created an aplication in C# windows application version 1.1 to display some records in a datagrid. The datasource of the datagrid is datatable and not any database.I want tht when we edit any cell of a particular column and press "Enter" it should show a Message Box let's …
I have a form with OpenFileDialog for selecting image and showing it in pictureBox. Until the form is open the user can open and then save the opened image as many times as he wants.But when he secont time open openfiledialog the picture show but the both image show in …
Hi im trying to Scrape a **table** of a website and list it in a **datagridview** wich has a column **Name** and a **Url Link** Please Help!!!! Heres the source.. <div class="text"><table class="links"> <thead> <tr class="thblue"><td style="width: 105px"></td><td style="width: 85px">Time</td><td style="width: 540px">Teams</td><td>Broadcast</td></tr> </thead> <tbody><img src='/img/nowplay.gif'><tr> <td colspan='5' class='accordion greybg'><span class='icon'><img …
namespace CountDown public partial class Form1 : Form { public int counter = 0; public Form1() { InitializeComponent(); } private void btnStart_Click(object sender, EventArgs e) { int parsedValue; if (!int.TryParse(txtInput.Text, out parsedValue)) { MessageBox.Show("Please Enter Numbers Only"); } else { counter = Convert.ToInt32(txtInput.Text); timer1 = new Timer(); timer1.Tick += new …
I am working with windows application, I have pictureBox to load image from the directory. I am trying to get some idea how can I display magnified image of particular area depending on the coordinates of that specific area on textbox focus.
I'm trying to draw a border around some controls in order to highlight them, but I'm getting unexpected behaviour, in that nothing is drawn. Here is a current event method. I've tried a few variations. private void checkBox1_Paint(object sender, PaintEventArgs e) { if (statechanged) { //Debug.WriteLine(checkBox1.Checked.ToString()); statechanged = false; ControlPaint.DrawBorder( …
Now, before you say it already exists (because it does) I found that those didn't really have the generic ability to find any control on a form, regardless of containers. So, here you have a piece of code which will find any control on a form and will also search …
Hi there Am a new student in C# and am using Microsoft Visual C# 2013. My aim is to i. open a child form inside its MDIparent form ii. disable the MDIparent form when the child form is active/opened it was easier in VB.net with frmStuDetails.ShowDialog() I have tried 1. …
how to get date from data grid view into datetime picker by clicking on cell ?? private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex]; textId.Text = row.Cells["Appointment ID"].Value.ToString(); textMobileNumber.Text = row.Cells["Mobile Number"].Value.ToString(); // Problem in this line --> dtpAppointmentdate.Text = row.Cells["Appointment Date"].Value.ToString(); …
how to get value of user type column into combox box , user type is 2nd table first is user so in combo box there's a list for example doctor ,abc,xyz and iam working on windows application data grid view cellContent click event when i click on any cell all …
I am trying to upload folders to comboBox 1 from the directory, and then at selection from comboBox 1 to comboBox2. I have below code, I am getting error when I make selection from comboBox 1 as direcory doesnot exists at bin/debug path of the project. private void Form1_Load(object sender, …
I am trying to upload folders to comboBox 1 from the directory, and then at selection from comboBox 1 to comboBox2. I have below code, I am getting error when I make selection from comboBox 1 as "Unbable to cast object of the type system.string to system.Io.DirectoryInfo { private void …
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication22 { public partial class Form1 : Form { private double subTotal = 0; public Form1() { InitializeComponent(); } private void btmAddItem_Click(object sender, EventArgs e) { double numberOne; double numberTwo; double …
I am starting a new application for our business to help maintain our client information, so it is going to be a very data driven application. I'm curious, from the standpoint of those who have used both and who may have constructive suggestions on the future direction of development, should …
Please excuse my terminoligy, as I'm not certain of it in regards winforms components. I have a ContextMenuStrip on my form and in it there are some SubItems created manually. I need to add more to SubItem dynamically. I'm unsure if I'm saying this correctly so I'll post a screen …
hello. i get data from two database db1, db2, into one datagridview, this dtatgridview has three columns[Id, Name, DirectorId], only the first row has no director, and each Id has one or more child, so that i want to create treeview that have one main node, and each node can …
Hi guys, I'm really stuck on this. I am not completely familiar with getters and setters so I am having great trouble with this. Firstly, I am using a windows form application and I have initialised a list within the 'Form1' class. I want to be able to use that …
hi this is my code and I am trying to write a simple code to generate total and grand total. I have **id,name,quantity,price,total,grand total** 'total' works perfectly,but I am having problem getting GT to work. here is the code.... the error I am getting is "Input string was not in …
Hi there, trying to do something I thought was pretty basic, but can't get around this error. I have a ListBox, List (AllImages) full of image paths, and two image elements. Image 1 displays the selected item, Image 2 displays selected item + 1 I have: `int inx = Convert.ToString(ImageList.SelectedIndex);` …
I am trying to programatically create and dispose of file system watchers, but I am running into an issue when trying to dispose of them. When I try to use the code: // dispose of any existing watchers. foreach (FileSystemWatcher fileWatcher in this.Controls) { fileWatcher.Dispose(); } I am receiving a …
hi, i would like to change the row color in a data grid view at runtime. i made this code but it didn't work [code] foreach (DataGridViewRow dgvr in dgvReservations.Rows) { string status = dgvr.Cells[10].Value.ToString() ; if (status == "Canceled") { dgvr.DefaultCellStyle.BackColor = Color.Red; } } [/code] not even this …
I want to show my custom control(eg: `monthcalendar`) as a drop-down (popup) window. One option is to use `ToolStripDropDown` and `ToolStripControlHost` as the second example in [msdn sample](https://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripdropdown(v=vs.110).aspx). Is it recommended to use ToolStripDropDown for controls other than the ToolStrip items ?
Here's a good one for everyone. I have been working on a Screensaver program for some time now (some of you may even remember questions related to this). Anyway, one of the biggest challanenges with developing it was finding a good way to transition images, smoothly, and not killing all …
is it possible to show c++ coding output which was made in empty project to windows form application program?? I made windows form for example i used spiltcontainer toolbox for panel 2 contains my c++ console output i expect someone's reply thank you
private void comboKeyPressed() { cboAuthor.DroppedDown = true; object[] originalList = (object[])cboAuthor.Tag; if (originalList == null) { // backup original list originalList = new object[cboAuthor.Items.Count]; cboAuthor.Items.CopyTo(originalList, 0); cboAuthor.Tag = originalList; } // prepare list of matching items string s = cboAuthor.Text.ToLower(); IEnumerable<object> newList = originalList; if (s.Length > 0) { newList …
Hello, I used the CodeDom provider to convert a string into an exe (the string is partial): string partial = "using System;\nusing gButtonnamespace;\nusing System.Windows.Forms;\nusing System.Drawing;"; partial+="\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Text;"; partial+="\nusing System.Threading.Tasks;\nusing System.Reflection;\nnamespace prog{static class program{static void Main(){"; partial += "Form thiss=new Form();\nApplication.EnableVisualStyles();"; partial += "thiss.ShowDialog();"; partial += "}}}"; CSharpCodeProvider codeProvider …
The End.