user-controls

Add Form to a UserControl - is this possible?

风格不统一 提交于 2020-01-09 11:33:08
问题 Normally, controls are being added to forms. But I need to do an opposite thing - add a Form instance to container user control. The reason behind this is that I need to embed a third-party application into my own. Converting the form to a user control is not feasible due to complexity. 回答1: This is possible by setting the form's TopLevel property to false. Which turns it into a child window, almost indistinguishable from a UserControl. Here's a sample user control with the required code:

Add Form to a UserControl - is this possible?

半城伤御伤魂 提交于 2020-01-09 11:33:05
问题 Normally, controls are being added to forms. But I need to do an opposite thing - add a Form instance to container user control. The reason behind this is that I need to embed a third-party application into my own. Converting the form to a user control is not feasible due to complexity. 回答1: This is possible by setting the form's TopLevel property to false. Which turns it into a child window, almost indistinguishable from a UserControl. Here's a sample user control with the required code:

UserControl with header and content - Allow dropping controls in content panel and Prevent dropping controls in header at design time

最后都变了- 提交于 2020-01-09 05:26:05
问题 I wrote User Control (yay!). But I want it to behave as a container. But wait! I know about [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] Trick. The problem is - I don't want all of my control to behave like container, but only one part. One - de facto - panel ;) To give wider context: I wrote a control that has Grid, some common buttons, labels and functionalities. But it also has a part where the user is supposed to drop his custom buttons

Displaying a collection of controls in Windows Forms

不羁岁月 提交于 2020-01-09 03:56:24
问题 I want to display something like the following :- Each row is about a process (information like PID, Parent etc.). User can check the checkbox and click Launch button to get some dynamic details about that process. The problem is that CheckedListBox control doesn't allow more than one columns and other controls like ListView (which allow multiple columns) don't allow controls like checkbox to be embedded in a columns. I want to know if there is a control which will allow me to have a list of

Getting data from child controls loaded programmatically

半世苍凉 提交于 2020-01-07 06:43:22
问题 I've created 2 controls to manipulate a data object: 1 for viewing and another for editing. On one page I load the "view" UserControl and pass data to it this way: ViewControl control = (ViewControl)LoadControl("ViewControl.ascx"); control.dataToView = dataObject; this.container.Controls.Add(control); That's all fine and inside the control I can grab that data and display it. Now I'm trying to follow a similar approach for editing. I have a different User Control for this (with some textboxes

Usercontrol background color not changes even after setting to transperent in wpf

余生长醉 提交于 2020-01-06 21:46:39
问题 Hi i have designed a usercontrol for using as an pop up and i have set the usercontrol background property as transperent but the background is not getting transperent I need that light orange to be transparent and here is my xaml code of user control <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com

ASP.NET GridView, enabling/disabling buttons after paging

*爱你&永不变心* 提交于 2020-01-06 18:13:31
问题 I have successfully implemented my GridView now, but, as always, the whole ASP.NET life cycle thing is bothering me. I can't figure out why this doesn't work. I have bound the GridView's OnPageIndexChanged as such: protected void GridView_PageIndexChanged(object sender, EventArgs e) { // Enable/disable the previous/next buttons. LinkButton btnNextPage = (LinkButton)gvTable.BottomPagerRow.FindControl("btnNextPage"); LinkButton btnPreviousPage = (LinkButton)gvTable.BottomPagerRow.FindControl(

ASP.NET GridView, enabling/disabling buttons after paging

百般思念 提交于 2020-01-06 18:13:17
问题 I have successfully implemented my GridView now, but, as always, the whole ASP.NET life cycle thing is bothering me. I can't figure out why this doesn't work. I have bound the GridView's OnPageIndexChanged as such: protected void GridView_PageIndexChanged(object sender, EventArgs e) { // Enable/disable the previous/next buttons. LinkButton btnNextPage = (LinkButton)gvTable.BottomPagerRow.FindControl("btnNextPage"); LinkButton btnPreviousPage = (LinkButton)gvTable.BottomPagerRow.FindControl(

Using a custom UserControl as a Column in a DataGridView

醉酒当歌 提交于 2020-01-06 15:39:06
问题 I've created a custom User Control that inherits from UserControl. It is pretty basic, it has some text fields, drop downs, and some radio buttons for right now. Ultimately I would like to string together 100's of these side by side to allow the user to fill out as many as they would like. The ideal solution to this would be to have a DataGridView where each column is an instance of my custom User Control. Is there a way to accomplish this? Or perhaps a better/alternative solution? My initial

background image of a css loaded as an embedded resource

╄→尐↘猪︶ㄣ 提交于 2020-01-06 15:18:07
问题 I have a control created in a Class Library and it should be styled by default with some CSS. I've created a CSS file, added it to the library and I am embedding it as a resource, so that it can be used for the default styling. The CSS file contains some classes that set the background-image property. The images used for this are added as embedded resources in my library as well. As expected, the CSS will run correctly, but it will not display the images since they are added relative to the