winforms

How to Link Different Form ?

I got great help in my first question n hopefully someone will tell me or refer me to an earlier question about this topic. I want to link different forms like I click on a button on first one and it opens the second one.Basically Im going to make a Menu for cellphone fucntions like SMS,CALL etc so I want that If I click on call a new f...

SSRS Report will not display in Landscape

I have a report in SQL 2005 reporting services. It is a server side report and the width is set to 11 inches and the height is set to 8 inches. When I run in in the VS designer, it works fine. However, when I display it in the report viewer control of my Windows application, it appears in portrait mode, not landscape mode like it shou...

Determine Where Activation Is Going When A Form Is Deactivated

Does anyone know of a way to determine which window is going to receive focus when a form is deactivated? ...

Keep Window Inactive In Appearance Even When Activated

Is there a way to keep a window inactive looking, even if it contains focus? I have two forms (A and B). After the user interacts with A, I transfer focus back to B. The result of the focus transfers (the user clicking on the A, then focus being transferred back to B) is that form A blinks from active to inactive. This looks ugly (es...

WinForms - Baffled - How to Handle Certain Controls Dynamically - Properly

I have a System.Windows.Form class (my main class). There is a RootMenu object. This is my own custom object. I'm trying to loop through the RootMenu object and on each pass add a ToolStripMenuItem to a ContextMenuStrip (which I named ContextMenu). The RootMenu object contains a List. Links have Names and Urls (both strings). When the f...

How might I remove focus from all items in a ListView control?

In a ListView control, the focus is on some Item within that control - that is, the control maintains its own internal notion of what is in focus, which can be retrieved using the FocusedItem property. I would like no items to be focused. In other words, I want the FocusedItem property to set to null. Any idea how I might accomplish th...

How to add large text to listview's(detailed) items?

Hello, I'm writing an analyzer,which shows the packets of a specific program.Some packets are very large and the listview shows only the first 15-20 characters :\ This is my code string __str = String.Join(" ", data.Select(x => x.ToString("x2")).ToArray()); //covert the byte[](packet) to hex string string __ascii = Asc...

Windows FORMS for Intranet instead of Web Based

Can we implement a enterprise wide intranet application completely with WinForms instead of Browser based Web apps? What are pros and cons and which is preferred over other? ...

How to put XmlNodes in TreeNode without using treeview?

Hi, i already have a project with TreeNode class which creates a hierachy of nodes like treeview. Now i want to add a XML node to that treenode. In a simple way i can do it by using windows forms Treeview widget, But i don't want to use that. Is there any other way through which i can add nodes to the treenode? Thanks.. ...

Transparent Panel on top of another normal panel.

Hi I want to show a transparent panel on top of another panel, both the panels have child controls like labels, text boxes etc. Transparency works fine if the transparent panel is child control of the other panel but if not then the label and text box of the normal panel appears on top of the transparent panel. Transparency for rest of...

Form.ShowDialog() or Form.ShowDialog(this) ?

Hello, I heard that if I call form.ShowDialog() without specifying the owner, then there can be a case when I will not see the dialog form on screen (it will be hidden with other windows). Is it true? I used ShowDialog() without specifying the owner hundreds of times and I never had any problems with that. Can you please explain in whi...

Can I set ShowDialog() to not be topmost?

Is there a way I can set a ShowDialog() to not be topmost? I've looked at all the related SO questions, and none quite matched my situation. What I do is open a new WinForm from a datagridview button column. This new form pulls information from a few SQLite tables and allows the user to add information to the row the button was clicked....

C#: How do you make sure that a row or item is selected in ListView before performing an action?

What is the best way to check if there is atleast a selected item in a listview or not in an if statement? ...

C#: Is there a way to SET the selected index of an item in listview at runtime?

C#: Is there a way to SET the selected index of an item in listview at runtime? ...

Raise button (or any control) click event manually. C#

Can anyone tell me how to raise click event of button control (or for that matter for any event). Platform: .net 2.0/3.0/3.5 Language: c# Domain: Windows Application, WinForms, etc. ...

C#: Problem with selecting different items after using ListView.SelectedItems[0].

I have a problem, I am using the method in listview ListView.SelectedItems[0] to return the currently selected ListViewItem into an argument in a function that displays the text of the item into a textbox when selected. This method is set to the Listview_SelectedIndexChanged event. The problem is that when I selected a different item now...

Using anchor property with dynamically added controls

I'm adding some textboxes to a form dynamically at runtime. Everything works fine i.e. the textboxes are aligned, anchored and automatically resizes until the form is maximized. On maximizing the form, the textboxes are added to the same location while the form was not maximized. This causes a misalignment of the textboxes. How can I en...

.NET Radiobuttons "content" design

I'm trying to decide the best way of having radiobuttons switch around the contents of a panel (or another container), using Windows Forms .NET (C#), and maintaining the ability to use the Visual Studio designer on the form/usercontrol that contains these. What I'd really like is something like the TabControl where I can select the page...

BackgroundWorker OnWorkCompleted throws cross-thread exception

I have a simple UserControl for database paging, that uses a controller to perform the actual DAL calls. I use a BackgroundWorker to perform the heavy lifting, and on the OnWorkCompleted event I re-enable some buttons, change a TextBox.Text property and raise an event for the parent form. Form A holds my UserControl. When I click on som...

how to pass values from one form to another

consider i ve 2 window form.. f1,f2 say now from f1 i should call f2.showdialog(). ...