winforms

C#: How to determine whether an relative path points outside an given path.

I have the following scenario (C#, WinForms). I have some kind of project file which is saved in some directory. The project file contains a reference to another file. This reference is relative from the place where the project file is saved. Sample: The project file is saved under c:\projects\project.xyz. The other file is referenced a...

Recursive Treeviews

Hi, I have a treeview being populated from sql on a c# winform pulling the root node and its child ids using the following methods. From there i have a label in the TVCTOptions_AfterSelect statement of the treeview to capture that ID of the selected node. The problem i have is it only pulls root ids and not the childs id. Any ideas wha...

How to show multiple tooltips on a control?

I would like to show 2 different tooltips on a control, both shown a the same time. Currently, when one is shown, and I try to show the other tooltip, the previous one disappears. How can I show both of them at the same time? PS: The two tooltip objects are different. ...

How to dynamically size the height and border of a ListView in View.Tile?

In a C# Winforms Application I have a ListView control. I am using the View.Tile mode and have run into two issues: The Tile truncates at a certain height (I haven't manually set anything). How do I get it to expand to fit the text? The Tile view doesn't show a border - how do I get the border to show? Or is the border issue relat...

Databind to a tooltip

Is there any way to bind a tooltip to a datasource. Here is a simplified example of what I am trying to do. I have a DataTable with two columns, one is a datetime the other is a varchar. This DataTable is bound to a BindingSource. That binding source has its current record bound to a label displaying the datetime column. How can I get t...

DataGridViewComboBoxCell clicking on arrow instead of text gives different results

the DataGridViewComboBoxCell (dgvcbc) has inconsistent behavior depending on where it is clicked to enter. Click the DataGridViewComboBoxCell once to gain focus. Click the Arrow portion of the combobox. Without using the mouse or arrow keys, type something. Press enter. . void Main() { Application.Run(new Form1()); } public par...

How to show full row highlighting for a ListViewItem?

I've got a ListView and, for View = List, would like to have the list items fill up the entire width of the control. That is, when you click an item the whole row is highlighted. I can't find any setting in the ListView or ListViewItem to control this behavior, and padding with spaces doesn't work very well because I cannot rely on the...

Button click event

Hi all I have a button in my program that supposed to be clicked after a while loop finished, whats the code to click the button? ...

Side menu in window form in .net

How do I create side menu in .net windows application? Is there any possible way to implement this using MDI or should I use some kind of splitter control? Or if you may know to do it with devexpress control, it would be nice too. ...

Adding huge number of items to a Listview

I have a listview, which is used as an index to a simple search application. Each item of the index is a word, and clicking on the item will add that item to the search textbox. The user can first click on any of the words she/he prefers to and them to the search textbox and then click search, to search in the documents. The problem is t...

How to get the current cursor from a WinForm WebBrowser control?

I'm having problems with getting the current cursor from the WinForm WebBrowser control. It's always returning the Default cursor. Mouse cursor changes depeding on what element it currently is on. If it's over a link then the Cursor changes to "Hand"; if on a TextBox then it becaomes an "IBeam". So, I want to somehow get that informatio...

How to add a winforms usercontrol in an aspx page

How can we add a winforms user control in an aspx page? Any help will be appreciated. ...

how to resize the size of a control automatically when the size of the form changes

I am drawing a rectangle on my form and on top of that i have a label that i dragged. Now i want to resize the rectangle that contains label so that it changes automatically when the size of the form is changed(maximized and all). I tried using this.label1.Size = new Size(); but this causes my label or may be rectangle to be disappeare...

C#: What if System.Windows.Forms.Timer interval was not enough for doing a job ?

hi First, sorry for my bad english writing. Suppose that we have a win form (C#) that has a timer. The timer interval has been set to 60000 milsec. So its tick event will be fired every 1 milute. Suppose we have written a method that handles tick event called Timer1_Tick. What if the job needs more that 1 minute to complete? ...

timer inside a thread

how to start a forms.timer inside a simple thread,i have a problem where i need to start a timer inside a thread,how can i do that ...

How to resize a rectangle according to the form it is drawn on?

I have a rectangle which i am drawing on a form. The rectangle is coded.I want to resize that rectangle according to the resizing of the form, that is as and when the form is resized, the rectangle is resized accordinly. How can I do it? Do i need to make changes in the way i am drawing the rectangle which by the way right now is like th...

Diaplay image issue.

I have a picture box (picture box 1) and in that box have drawn a rectangle and displayed the drawn portion using another picture box (picture box 2). Problem is when i draw rectangle (in picture box 1)the picture box 2 will not shows up but when change the position of the form (move the form) the picture box 2 shows up. How to display ...

Can a WPF-style splash screen be achieved in a Forms application?

Whilst playing around with resources in my visual studio 10 project, I came across a build action called "Splash Screen", which led me to find this article on the neat splash screen capabilities of WPF. Hunting around, I found this MSDN article on making a splash screen in Windows Forms, but it's a different type of approach: rather tha...

Should I choose Line or FastLine in Windows Forms Chart Control?

I am currently using Microsoft's chart control - the MSDN documentation for it is here I am examining the SeriesChartType documentation, which is mostly unneeded, except for one question: What is the difference between the Line and FastLine types? When should I favor one type over the other? Thank you in advance for any help. ...

MDI Child Form Load

Loading multiple child forms from a loop into a MDI parent form. They are displayed one at a time. I would like to display all the created forms at once. I tried only using the .Show() method after they are all created, but they still only display one at a time. ...