winforms

Refreshing Windows program when other users make changes?

Scenario: 4 users launch separate instances of the same client program (Winforms) that is connected to a database based To-Do list. The first user selects the 3rd To-Do list item. How do I update/refresh the other 3 users screens to reflect that item #3 is no longer available? My thought was a table that contains the last update d...

Cannot get databinding to work

I am having difficulty binding to a property on my object. This is my property: private int? Tid; private int? innerTenantID { get { return Tid; } set { Tid = value; innerTenant = (value.HasValue)? Tenant.GetTenantByID(value.Value) : null; } } And this is my attempt to ...

Windows Forms: Highlight destination node in TreeView during Drag&Drop

I created Drag&Drop mechanism for my TreeView. I added DragEnter, DragDrop and ItemDrag methods and everything works fine. But when you are doing D&D with standard Windows controls, destination node is highlighted. Image is worth 1000 words, video probably even more: http://www.youtube.com/watch?v=PlltSiihHPo I mean such highlight effe...

setting a minimum allowed size for the panels of SplitterContainer

Greeting, in C# WinForms: I have a splitterContainer. and lets sat there is Docked to Fill TableLayout in SplitterContainer.Panel1 now when I move the Splitter bar, it can cover the area of each of its panels. so it can even hide one of its panels when we move the splitter bar. But I do not want it! I want to have a limit for that. the ...

Data URI Scheme not working in IE8 WebBrowser Control .net

Hi, I am using a WinForms WebBrowser Control and the webpage that I am being served has a data URI scheme and it doesn't seem to work. (for e.g. "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAoAAA...) It works in IE8 browser though and I know for a fact that it is not supported in IE6 or IE7. My question is, why is the Winforms WebBr...

C# window form not showing up at all.

I have a program that displays and runs C# GUI by Application.Run(new Dialog()); But it shows absolutely nothing. It used to work as intended, but after I made some changes and my computer crashed, it shows nothing, but it's running. What I mean by it's running is that when I run debugger, it steps into constructors and behave as i...

Undo in RichTextBox does not undo Pasted Text

I have a WinForms RichTextBox and by default the Undo works for most things, but when I Paste some Text in (I have stripped it of formatting it is just plain text), and try undo it does not undo the text just pasted. Any help to a solution? ...

cross-thread operation even when executing on UI thread

I have a function which adds a control to a parent control which is called from threads different to the thread the controls were created on. This is how it goes: 1 delegate void AddControlToParentDelegate(Control child, Control parent); 2 private void addControlToParent(Control child, Control parent) { 3 if (parent...

Tying ctrl hotkeys to winform buttons

It's easy to set up an alt hotkey for a winform button by adding an & in front of the hotkey character in the text property of the button. Now, I need to create a control with around 50 buttons (don't ask), and the desire is to have a hot key for each of them, utilizing ctrl hotkeys as well as alt hotkeys. Also, it is desired to have t...

How to save a treeview selected node when I pressed a Tab key ?

Hello guys, I have a treeview control. I use keyboard to navigate through nodes. I want to save a SelectedNode when I pressed a TAB key. How ? "Save" : I mean it makes a selectednode == null when I press TAB key. I want that selected node still remains selected even if I pressed a TAB key inside treeview control. C#, WinForms, 3.5, VS...

C# WindowsForms equivalent for VB6 indexed controls

In VB6 you have the ability to name your controls with an index. i.e.: cmdStartInterval(1), cmdStartInterval(2), ... . Then you have a method head like this: Private Sub cmdStartInterval_Click(Index As Integer) ... End Sub Is this also possible in a similary way in C#? ...

Is it possible to let linq to sql auto submit my new records back to database ?

I am using linq to sql , and I return a queryable result from linq to sql : var qry = from p in table select p; Then I use this to bind to a xtragrid: GridControl.DataSource = qry; Then If I edit the records in xtraGrid, I just need to call dataContext.submitChanges() to submit the changes back to database. My question is : Am I ...

subscribe to msmq

How to a subscribe to a queue in msmq using c#. Assuming i have a client as a win form and would like to subscribe to a que, everytime a message is arrived in the que i would like the form to be notified about it. Any example. Thanks ...

Firing custom events / General event handling

I'm getting into event handling now, and it seems quite confusing to me. See, I come from a web-dev background, so this event stuff is quite new to me. I'm developing in C# / VS08 and created my Application in the WinForm-Designer. Now, I created this program overview; ProgramContext MainForm : Form LoginForm : Form So, what I wan...

Inject JavaScript with jQuery at runtime into WebBrowser

I have desktop application with WebBrowser control and try to inject JavaScript into loaded page. For this I added two script elements: private static void AddJQueryElement(HtmlElement head) { HtmlElement scriptEl = head.Document.CreateElement("script"); IHTMLScriptElement jQueryElement = (IHTMLSc...

C# Validate an Administrator from Login information.

I'm having a bit of a problem with an application I am writing in C#. I can't seem to find a way to check if a user is an administrator just from their username and password. I haven't seen anything helpful for doing this elsewhere and all tries to attempting such with WindowsIdentity end up helpless. I am aware of UAC programming with W...

how to ask if any date format fit to another ?

hi how to ask in C# Winform if this format: ddd MMM d HH:mm:ss yyyy == true then convert to dd/MM/yyyy format thank's in advance ...

Add something like ShowDialog to a custom User Control?

When a user selects a button a custom user control is added to the form. This user control provides the ability to enter in some values. How do I wait for the user control to complete before changing the value on my main form? I was thinking of something like this: customControl ylc = new customControl(); ylc.Location = new Point(11,...

KeyPreview not handling KeyUp Event before control does.

I have a form, myForm, which has KeyPreview set to true. The idea is that I want to capture CTRL-Enter and fire the submit button of the form, no matter what textbox (or other control) that may have focus. So I set up this method: private void myForm_KeyUp(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.Enter) ...

Crystal report parameters aren't being prompted

I'm working on upgrading our application to use Crystal Reports 2008. (v12) Currently, we use Crystal Reports 2008 for Visual Studio. (v10.5 nice naming convention jerks) Most of the time, our application supplies report parameters itself, using the id/name/whatever of the object the user is currently looking at. This is pretty normal...