Questions tagged [winforms]

34376 questions
1

votes
1

answer
114

Views

DataGridView is not committing updates to database

I used the designer to set the datagridview's data source to my SQL database table. On the RowLeave event, I use the BindingSource.EndEdit to commit the changes. However, the changes in the datagridview aren't being reflected in the database. The EndEdit is being called correctly. private void UI_DG...
B-Rian
1

votes
1

answer
63

Views

Binded DataGridView only updating the currently selected row

I'm working on getting my DataGridView controls to auto update the values of my objects in my object model. I have object arrays that I'm binding to my DataGridView through the following code Dim bs As BindingSource = New BindingSource() bs.DataSource = aryJoints DataGridJoints.DataSource = bs I am...
RobotGuy
1

votes
2

answer
158

Views

C# Handling two buttons within the DataGridView

I'm currently developing a C# project that displays the users' orders. Now, being that I am new to this I'm asking you to assist me on how I could possibly access the two buttons from within the DataGridView and give them separate functions. Where I've got at code wise: private void dataGridView1_C...
user7943
1

votes
0

answer
34

Views

Store logged in user for that session

We all know how easy it is to create a static class in c# and use that to reference that in a app but its a possible to make a variable that can change I am wanting to track the user id of a user once they have logged in in something like this public static class MyUser { public static int UserId {g...
rogue39nin
1

votes
1

answer
49

Views

C# Assistance in foreach datagridview data removal

Scenario: I am loading a DataGridView with data from a database, so in order to do so I'm using a foreach-loop, now the problem here is that when going on the DataGridView for the second time it loads the data from before and the data being looped in now. In order to fix that I did this: private vo...
user7943
1

votes
1

answer
163

Views

C# Winform How to change form nonclient area size?

I've already implemented a change to the size of the nonclient area but encountered a problem. Bug : Whenever I maximize the window and restore it again, its width and height will increase. This is my code: private void WmNcCalcSize(ref Message m) { if (m.WParam != IntPtr.Zero) { Win32.NCCALCSIZE_PA...
Zohn_Zhang
1

votes
1

answer
27

Views

How can I update my List loop in my DataGridView?

I have a list attached to the datasource of a gridview, when I make the change from my list in the status field I would like to change the status in gridview as well. My loop is through the datagridview and it is linked in my list, I think the problem is this? How can I update my List loop in my Dat...
Will
1

votes
1

answer
50

Views

unrendered portion for datagridview c#

So I'm doing a project on Win-forms using c# and i have this DataGridView that's anchored to the each left and right side of the panel. For some reason the right side of the DataGrid is not rendered for some reason.(image in the link below) If i rescaled my PC resolution when running it will fix the...
user9177098
1

votes
1

answer
53

Views

DropDownMenuItem check should uncheck other DropDownMenuItems

I'm creating a ToolStripMenuItem's DropDownItems at runtime. Me.mnuExtrasSecondaryLCID.DropDownItems.Clear() Dim iCount As Integer = -1 For Each nLang As clsLanguage In g_LCIDs If nLang.IsLeader Then iCount += 1 Dim n As New ToolStripMenuItem n.Name = 'mnuSecondaryLCID' & iCount.ToString() n.Text =...
tmighty
1

votes
0

answer
195

Views

Why is DataGridView (re)draw so slow?

I know there are several questions in SO about slow DataGridViews, but I tried really everything mentioned there and most are about more complex databinding. what I did before: I tested DataTable as Datasource unbound Datagridview, populated in a loop tested many setting with autoColumnResizing etc....
Falco Alexander
1

votes
1

answer
42

Views

Windows application compatible with Microsft Edge share command

Microsft Edge has a share command that sends a link to the current page to other apps like Mail, OneNote, Skype, etc. I'd like to obtain that my application appears in that list and can receive the target link. How can I get this functionality in my Windows Form application in C#? Or I need to conve...
Danilo.NET
1

votes
0

answer
167

Views

Double buffering during Resize when Control is docked to Form?

I have a custom Control derived class for which I want to disable any automatic double buffering completely because I want to handle double buffering manually with a BufferedGraphics object. Drawing is done in OnPaint, Invalidate is called in MouseMove and Resize events for example. However, if the...
oliver
1

votes
3

answer
529

Views

Uncheck an item and “Select All” option from CheckedListBox on Windows Form

I have added a checkbox list with some names and a select all option. I am able to select all check boxes in checkbox list when I select (Select all) option. Problem here is, I am not able to uncheck (Select All) option whenever I uncheck any of the options from check box list. Below is the vb.net c...
RBK
1

votes
0

answer
41

Views

Treeview And Panel in C#, Case go to next form

I am trying to make a desktop application using treeview and Panel it works fine a bit. But when i try to does not change like for instance, if i click Account opening, it opens the form, but if i click to go to a different form inside the application (For instance Transfers) it doesn't change , you...
Qalid
1

votes
3

answer
303

Views

Split filename and arguments from user string

I'm writing a toolbox program in C# and on of its functions is to emulate the Windows Start menu 'Run' dialog, but also to allow the user to elevate the privileges if needed. For this, I have a simple WinForm with a textBox (where the user types), and a checkBox (if checked, add the 'runas' verb). A...
Dédé Lateur
1

votes
0

answer
170

Views

OnAfterInstall not working after installation winform c#

I'm new to winform programming and trying to generating exe setup file, for that I'm using MicrosoftVisualStudio2015InstallerProjects. I've created .exe file and it's working fine, but after installation every time I need to go the installation directory and give permission to the user. To get rid o...
Hina Khuman
1

votes
0

answer
90

Views

C# UserControl Draw outside of TableLayoutPanel cell

C# .Net 4.5 Winform On my Form, I have a SplitContainer, and in the right panel, my custom UserControl with a TableLayoutPanel. As I draw UserControl items in each cell of the TableLayoutPanel, I want to use DrawString to display text on the division of the current cell and the cell above it. Curre...
Robert Achmann
1

votes
0

answer
36

Views

Scaling a WebBrowswer containing an .xps document

I'm trying to display an .xps document to a separate window. I put it in a WebBrowser, I get the document I'm after. Unfortunately, the target platform is a huge 4k monitor meant to be seen from some distance away--and it shows up unacceptably small. I'm getting nowhere on trying to scale the disp...
Loren Pechtel
1

votes
0

answer
36

Views

Checking whether WinForms app is rendered with OS visual styles

We have a legacy WinForms app written at the times of .NET 1.x and may need to change the code that checks whether the app is rendered with the OS visual styles for the reason described below. The current function that does this work looks like this: private bool IsComCtl6 { get { if (!fIsComCtl6Ini...
TecMan
1

votes
0

answer
127

Views

System.Byte[] on Datagridview

I am getting data from oracle database to datagridview. The column type in Oracle is = RAW(8 BYTE) However when i bind this to datagrid it doesn't show the values. It just shows System.Byte[] in all rows for that column. Example real value is = 000000006F478320 Also i found the data type mapping ho...
john true
1

votes
0

answer
79

Views

How does DwmQueryThumbnailSourceSize determine window size?

I wrote an Alt-Tab replacement application. I use DwmQueryThumbnailSourceSize to determine window sizes, and construct my layout. However this function is available only after I have already constructed the Dwm thumbnails. If I knew the window sizes beforehand, my application could be faster, cleane...
Frigo
1

votes
1

answer
23

Views

Bound datasources being updated in non-UI threads

I'm trying to use Grpc, which in its example for bi-directional streaming uses this example: using (var call = client.RouteChat()) { var responseReaderTask = Task.Run(async () => { while (await call.ResponseStream.MoveNext()) { // // What if I want to update a list bound to a UI // control here? //...
Nils Guillermin
1

votes
1

answer
336

Views

Bluetooth serial with C# and Mono on Raspbian?

I've been trying to create a C# Windows Forms Bluetooth serial application and then run it via Mono on my Raspberry Pi 3. I tried the following: String SelectedDevice = AvailableDevicesComboBox.SelectedItem.ToString(); BSerialPort = new SerialPort(SelectedDevice, 115200, Parity.None, 8, StopBits.One...
Martin
1

votes
0

answer
235

Views

Visual Basic WinForms Displaying Windows10 Toast Notifications Issue

Windows refuses to show my Toast Notification, its probably because my program doesn't have permissions to send them. The only problem is that I can't find a way to give those permissions to the code. My toast code: Dim toastXML As New Windows.Data.Xml.Dom.XmlDocument toastXML.LoadXml(' ''zz'' ''zz'...
1

votes
0

answer
56

Views

Winforms Designer Error: netstandard assembly not found; only with netstandard.library.netframework Nuget

When I try to start my WinForms Designer then I get the following Error: The error message is telling us, that the designer got an exception, because of the element DevExpress.XtraEditors.DateEdit. And that the datamember propery ´ProductionOrder´cannot be found. So when I go futher to find out wh...
JonKAS
1

votes
1

answer
231

Views

How do I make an analog clock using winforms in F#?

I have to create an analog clock using winforms in F#. The clock needs also to have a label showing date and time in digital form. I have figured how make the label with time and date, as well as drawing the circle and the clockhands, but I'm having trouble with how i'm gonna implement the timer fun...
Chrizzar
1

votes
1

answer
244

Views

Application Installer: Microsoft database engine 2010 not available under pre-requisites

I have a windows form c-sharp application developed for windows 10. When I am trying to make installer, I cannot find 'microsoft database engine 2010' (important for my app) under the 'prerequisite' as shown below: I do not want my customer to separately download it and install it. So is there a wa...
gpuguy
1

votes
0

answer
315

Views

How to fill datatable from database in background worker and show progress in c# winform?

I am trying to fill a DataTable from database in background worker, and i want to show a progress update form meanwhile. I know i can use a loop to show the progress, but how can i show the progress as it progress to fill the table? This is the code that i have used to show a progress bar in a new...
Usman Farooq
1

votes
0

answer
60

Views

C# Form Size won't not set

i have a panel in a form and i load another form in this. this new loaded form have a picture box and the picture was larger as the main form. i want to scroll in the new form and show the picture. i set the size of the new form in code but in the breakpoint i can see the size show the right setting...
Pla558
1

votes
1

answer
283

Views

How to use PictureBox with MDI form?

I have an MDI windows form and many child windows forms in vb.net. What exactly done that the Mdi form have a PictureBox control over it. If I call a child form from mdi form then PictureBox of MDI form overlap the child form mean it hides the child form behind the PictureBox of MDI windows form. Ho...
AlQaqaa Benghuzi
1

votes
1

answer
41

Views

ILNumerics hide PlotCube

I have a scene with two different PlotCubes, wich have to be displayed individually. What is the best procedure to hide and show the PlotCubes. I have tried with remove, but this seems to alter the PlotCube-objects. The code-lines are: IlPanel1.Scene.add(PlotCube1) IlPanel1.Scene.add(PlotCube2)...
ISE
1

votes
0

answer
76

Views

How to keep standard input stream open?

I am redirecting all streams (in/out/error) from a commandline application that runs some ChaiScript scripts. The user is able to interact with a running script via input commands such as PromptForDouble('Enter a double:'); which are defined in the separate commandline application and not my C# prog...
KingDan
1

votes
0

answer
48

Views

creating external Panel files in C# Winforms

So I'm currently working on a C# Windows Form App in Visual Studio 2017 What I'd like to do is create several different external Panel files, then switch them out on the main form as the user navigates around. I used this same technique for a Java GUI before and it worked great. However I can't see...
Samuel Lloyd
1

votes
0

answer
268

Views

is it possible to control .net WebBrowser object using Selenium in winforms?

I am using Selenium driver with real browsers chrome , firefox etceverything works fine, I am wondering if I can use selenium to run tests on the webbrowser Control in a winform project , instead of running everything on a real browser i want to run the tests on the WebBrowser Control .
zakaria kasmi
1

votes
1

answer
59

Views

Parent Dialog Closes When Child Dialog is Closed

I have a form that I open using ParentForm.ShowDialog(). Inside this form I call: using (var form = new ChildForm()) { var result = form.ShowDialog(); if (result == DialogResult.OK) { this.Cancelled = false; } } I'm getting odd behavior when the child dialog is closed, the parent (calling) form also...
James Wadsworth
1

votes
0

answer
34

Views

C# Charting - How to prevent auto refresh for AddXY Method

I have a windows forms application with a chart. private System.Windows.Forms.DataVisualization.Charting.Chart myChart; Whenever I add points to that chart with: myChart.Series[0].Points.AddXY(x, y); the chart updates and respectivly also raises an event. I don't want to update the chart upon adding...
CaptIglu
1

votes
0

answer
165

Views

Add UserControl on WinForm pythonnet

I am trying to add UserControl to a WinForm using PythonNet but not having any luck. For testing, I added a button and that shows up but not the UserControl and I am not sure what I a doing wrong. All the code can be placed into one py file. I broke into a few sections hoping it will be easier to re...
Musa Biralo
1

votes
0

answer
39

Views

XtraScheduler complex recurrence

Let's say I have a simple recurrent event **Do stuff once every 5th day at 3am ** That would be Appointment apt = scheduler.Storage.CreateAppointment(AppointmentType.Pattern); apt.Start = DateTime.Today.AddHours(3); apt.End = apt.Start.AddMinutes(15); apt.Subject = 'My Subject'; apt.Location = 'My L...
Mare Milojkovic
1

votes
0

answer
248

Views

C# WinForms DataGridView: drop down opened/closed event?

Is there a chance to know when the dropdown list of a DataGridViewComboBoxColumn is opened (and closed), regardless of the eventual value change? I'm asking because I'd like to stop the underlying DataSource from updating, while the dropdown list is open. The DataSource updates once every second, an...
Alberto
1

votes
0

answer
292

Views

Windows Forms Example with EmguCV - Could not load file or assembly 'Emgu.CV.World' (Code 0x80131040)

What I'm trying to do is use an instance of EmguCV's own ImageViewer class from the Emgu.CV.UI namespace in the default template Visual Studio 2017 loads when a Windows Forms application project is created. For some reason, on the following line Application.Run(new ImageViewer()); I am getting the f...
user9236834

View additional questions