winforms

WCF based WinForms app in standalone mode

Hi, I have a windows application that has its business logic layer implemented as a WCF service. This service is currently hosted on IIS. I wanted to know that if there's a way where I could optionally run the application in standalone mode when a service isn't available/feasible. ...

how to let a worker thread update the ui in window forms [without using Control.Invoke()] ?

i know the way that uses the Control.InvokeRequired() and Control.Invoke(). but i was wondering if its possible to use some other method to alert the ui thread that the Data was changed and then let the ui thread update its controls without using control.invoke(). as far as i remember this was possible before in mfc by sending message...

Updating my table's datagridviewcomboboxcolumns directly.

Hello community, [Note : I've simplified my example for clarity] Let's say that I have a Sqlite database with two tables: Items and Sectors: Items: id_items : INTEGER PRIMARY KEY name_item : VARCHAR(...) id_sector : INTEGER Sectors: id_sector : INTEGER PRIMARY KEY name_sector : VARCHAR(...) I currently have a datagridview that i...

Strange behaviour with mouse hook in .net, winforms

I have a form that is displayed, not by ShowDialog, but by setting it's visible property to true. This is so it behaves like a dropdown. The form installs a mouse hook, using SetWindowsHookEx(WH_MOUSE, ...) I detect if the mouse is clicked outside of the dropdown and if so, return 1 in my HookProc method and close the dropdown. The st...

Using The Controls Of One Form Into Another

Hello, I have a application that in one form(Form1) I have many checkBoxes and textBoxes and in Form2 I have only a textBox, but I want to put some contents from the Form1 textBoxes and put in the Form2 textBox, like this, but between forms: textBox1.Text = "Test: " + textBox1 + "\n" + textBox3; As textBox1 in Form2 and the second te...

VB: Allowing Only Numbers (not Letters) To Be Entered Into Textbox

I have a textbox which controls the interval of a Timer control. How do I filter out letters? Is it possible to restrict entry to numbers only (like if you enter a letter or a space, nothing happens)? Is there a property of the textbox that can accomplish this? Thanks! ...

How to get the timeout of the Forms authentication from a client connecting through Client Application Services?

I have an ASP.NET website configured with <authentication mode="Forms"> <forms loginUrl="Login.aspx" timeout="10080"> </forms> </authentication> and a WinForm app using Client Application Services for login. How can I find the "timeout" parameter from the WinForm app? ...

Binding data to a Data Repeater - VB.NET ?

I'm looking for a line or two of code that will bind a DataSet.Datatable column to a textbox on a Datarepeater? ...

Winforms : avoid freeze application

Hello, I do some operation on "big" file (around 4Mb) I do this : 1. Get all files from a directory and place them in an IList MyInfoClass has properties : name, extension, fullPath, creationDate, contentPart 2. I do a Linq query to get only some extension type. 3. I loop on the Linq query result and for each, I open the file, do some ...

Window is not maxinizing/being brought to front after being in tray, why?/help

I wrote an alarm app with some complex code i dont feel like breaking up right now to use as an example. I have a timer checking every 10 or so minutes about a state online and on certain conditions my app alerts me. On form_load i set the timer to 10mins and when it triggers and the condition is true i call a function with this in it. ...

Using CreateWindow and adding buttons and such to it? How?

This is kind of a noob question but I've realized after so long of coding DirectX/OpenGL applications I don't have the feintest of ideas how to create windows with basic form objects like text boxes, labels, command buttons etc. I can create a window using the CreateWindow function just fine, how can I add buttons, command prompts and o...

How does one run screensaver within Windows Form as background for it?

How does one run screensaver within Windows Form as background for it? User also can interact with form controls while screensaver running. [Why this?] We have a case which we need to run Windows Bubbles screensaver while user can continue interacting with form controls? ...

Best way to implement socket listener in C#

Hi, I did search for answers already, but can't find anything similar... I'm fairly new to C#. I need to create a program in C# using WinForms. It basically has 2 components: UI and then I need to have a process that permanently listens on a socket TCP port. If there's anything received, then I need to raise an event or something simil...

Localization problem

I need to make a form that have to suport two languages (for now). the two languages dont have the same look and also half of the form is not a like but it still have some similiarity beetwen them. what is the best way to deal with this problem in a case of two different languages and above? by the way, the program language that I use is...

How to change the behavior of the DataGridView when clicking a column?

Hi there! When I click a column of the DataGridView control, the control sorts all the data according to the column. Is it possible to disable this function? (Actually I want to select the whole column as in Excel or Word tables.) Thanks! ...

C# and Month Calendar, selecting multiple dates

I am making a program that will help people "book" orders for a department in C#. They need to be able to choose multiple dates in different months. I would prefer to have it so they can click a date, and then shift click another one to select all dates between those two, and control clicking as well, to do single selection/deselection...

How do I disable the c# message box beep?

Whenever trigger a messagebox used in my C# program I get a very annoying beep from my computer. How do I disable this beep using C# code. The code I am using is very simple. MessageBox.show("text"); ...

Are there any .Net libraries to include mapping in a WinForms application?

I'm wanting to write a simple WinForms application that will be able to plot several locations on a map. Ideally, the application would embed a map that I can programmatically manipulate, and be able to add locations to the map using postal codes. Is anyone aware of any free maps I can use within my application, ideally with either a .N...

add row to a BindingSource gives different autoincrement value from whats saved into DB

I have a DataGridView that shows list of records and when I hit a insert button, a form should add a new record, edit its values and save it. I have a BindingSource bound to a DataGridView. I pass is as a parameter to a NEW RECORD form so // When the form opens it add a new row and de DataGridView display this new record at this time D...

Bind Winform control property to a property on User Control using INotifyPropertyChanged

Hi there! Please advise me. Winforms app, C#. I have a user control (UC) that contains a DataGridView. Firstly, I have a boolean public property in the UC called "IsComplete". in the RowEnter event of my DGV, Im able to set the property accordingly. Secondly, I successfully instantiate and load this UC into its designated area in ...