IDE :: Design A ContextMenuStrip In A Designer Without A Relation To A Specific Form Or UserControl Class?

Oct 16, 2011

in VS 2008, is there a way to design a ContextMenuStrip in a designer without a relation to a specific Form or UserControl class? For example,if you need the same ContextMenuStrip in Form1, Form2 and Form3, in which of them am I to design the ContextMenuStrip? Do I have to add a "pseudo-Form" to the project that contains my shared ContextMenuStrips and create only one instance of that Form, or is there another way? I consider this a programmatic hack, that's why my question is whether the IDE offers something better.

View 10 Replies


ADVERTISEMENT

Get A ContextMenuStrip In Relation To The Parent Control It's Under?

Dec 30, 2009

I've made a ContextMenuStrip to use in my program to change the image in a picture box. However, it's used with multiple picture boxes which each need to have their own changed. What I want to do is make my command change only that picture box leaving the others as they were before. An example, if this were a plausible code.

Private Sub TestToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TestToolStripMenuItem.Click
Self(aka the control that currently has the menu open).Image = My.Resources.Picture
End Sub

View 2 Replies

.net - Edit UserControl Subclass In Windows Form Designer?

Jul 1, 2011

In VS2010, targeting Framework 4.0, I have a UserControl which contains a TableLayoutPanel with an empty second row.Is it possible to add items to this second row using the Windows Forms Designer, or do I have to do it all via code?

EDIT: In reply to Hans Passant's comment, the linked question references a UserControl being used inside another control.I am asking a question about inherited controls.I have created the following test code, where TestControl is a UserControl containing a TableLayoutPanel named "TableLayoutPanel1":

Imports System.ComponentModel
Imports System.Windows.Forms.Design
<Designer(GetType(testDesigner))>[code]....

creates a control which, when viewed in the designer, contained a TableLayoutPanel named "TableLayoutPanel1" which is not designer-editable.Creating a new UserControl, not inheriting from either of the previous UserControls, and then placing a TestControl into it creates an instance of TestControl with a Designer-editable TableLayoutPanel named "TestControl1.TableLayoutPanelX".Is there any way to make the TestInheritedControl class, shown above, Designer-editable?

View 1 Replies

UserControl Disappears From Form Design View On Run?

Jul 24, 2009

I have a custom UserControl that I am hosting inside a FlowLayoutPanel. Each time that I run the application the control will disappear off the hosting form's design view. I have to close the form's design view and then reopen it each time. The control is not getting removed in any way, just isn't being shown.

Edit, alright this got a bit weirder. Only the first usercontrol that I put into the FlowLayoutPanel disappears. This problem also happens on a project Build and Rebuild.

View 8 Replies

DB/Reporting :: Relation DB Design?

Apr 21, 2010

I am designing a system for our sales team to enter their sales expenses. I have designed an input form and need some advise on what exactly I should store in the expenses table VS lookup from the employee table.

First, the form has a text box where the user must enter their EmployeeID. Management asked for a text box VS a combo box because they do not want users looking at each others expenses. The form has a search feature where by after you enter your employee number, it will look for an existing expense ticket first before allowing you to create a new one. Anyway, here are some of the decisions I have to make.

When the user enters their employee number, I would like to display their employee name. The EmployeeID is saved in the Expense table but should I also store the name in the expsense table? If I do save it, it's duplication of data, if I do not, I have to look it up each time the record is loaded. But is there a point storing the name long term? Does this qualify as related data? If I was to perform some reporting, could this cause a problem if an employee changes their name etc.

The expense data is spread over 2 tables, the first for the header details including employeeID, expense date and Expense ID etc. The second table contains the expense lines information. Amount, customer, category etc. My next question is when the employee chooses an expense category, there is an associated general Ledger code with that category. Again, the expense category data is stored in a table. When the user chooses the expense category, should I store the categoryID or store the values associated with the ID (GLAcct, CategoryDescription etc.) Does this qualify as related data or should lookup values always be duplicated in the master table? It is possible that over time, the GL accounts associated with the Expense categories could change. So for accuracy purposes, should they be stored in the expense lines table?

View 2 Replies

Replace The Native ContextMenuStrip Of An AXWebBrowser With One Of Own Design?

Aug 15, 2009

I'm am amateur but avid computer programmer. I have been trying to find the best ways and methods to design my own webbrowsing program, like so many others individuals, using Visual Basic 2008.

A few things are a mystery to me, such as how to replace the native contextmenustrip (cms) of a Microsoft WebBrowser (imported AXWebBrowser, not to be confused with the standard WebBrowser control in VB) with the contextmenustrip of my own design.

I've searched Google, MSDN, and other potential knowledge bases to no avail.

Allow me to repeat, I am not using the VB-standard "webbrowser" control that comes pre-loaded in VB. What I am using on my Form is an "AXWebBrowser" control, a reference to the Microsoft WebBrowser that I have added myself. It has much better functionality, as far as I am concerned.

how to replace the contextmenustrip for the AXWebBrowser?

View 1 Replies

VS 2005 Using A Common Base Class For Form And Usercontrol

Aug 10, 2009

I happen to have these common procedures which I want to be used in my forms and usercontrols, with the form I can put those procedures in the base form which is being inherited but I happen to have a need to use those same procedures in my usercontrols, is there a way that I can have a common base class that I can use both for my form and usercontrol? I haven't used yet a base usercontrol since my usercontrols will not look the same so I have to put those procedures in each one of them and I find it rather cumbersome.

View 8 Replies

Declare A WithEvents Class In Windows Form Designer Which Is Not Control Base

Jun 4, 2011

I am making a TabStrip control to hold a number of tabs just like TabControl, but only with the tabs, no page. The control has a "Tabs Collection", which stores a list of "Tab" class. "Tab" is not inherited from Control, but each tab has its events. So when the user add a "Tab" in the "Tabs Collection", each "Tab" instance should have a (Name) identifier, which user can access it in the code, and with WithEvents keyword so users can add event handlers to each "Tab". The expected out come should similar to this:

Friend TabStrip1 As TabStrip
Friend WithEvents t1 As Tab
...
Me.TabStrip1.Tabs.Add(t1)

[Code]....

View 3 Replies

IDE :: Declare A UserControl As MustInherit, And Then Use Its Child Classes In The Designer?

Aug 13, 2009

When attempting to create a UserControl type that must be inherited, when I try to edit one of its child classes in the Form Designer, I am not allowed to edit the child UserControl with the message:

To prevent possible data loss before loading the designer, the following errors must be resolved:
1 Error

The designer must create an instance of type "XX_ExpandContentsPanel2.IOCardMaster", but it cannot because the type is declared as abstract.

This error goes away if I remove the "MustInherit" restriction.Is there some way around this or do I just have to accept the (bonkers-mad) restriction, and not declare my class as as MustInherit, even though it's not a useful control in its own right?

View 2 Replies

Simple Usercontrol's Designer-generated Code Has Errors In It?

Jul 21, 2009

So I've created a very simple UserControl that is pretty much just a combo box that has US States in it and a couple properties to return the selected value as an enumeration or a string, etc.The enumeration and string values I'm using are being referenced from an external library which is working. However, when I add my user control to another project the designer-generated code has errors in it. [code] I would assume that this probably has something to do with project settings or something similar for the user control. The control itself is in a separate project and compiled as a .dll which has been added to my main project's toolbox and subsequently added to my form. [code]

View 11 Replies

Usercontrol With Designer Browsable Property Not Saving Value At Run Time?

Aug 17, 2011

I have been making a control and have added a property for a list(of CustomClass). The custom class contains a string, an image and a list of another custom class which contains a string and an image. I have added this property to the designer by adding the browsable attributes and all appears to work correctly with this.

My problem comes when running the program. I can set all of the values within the property and I can go back to them and they are saved, however, as soon as I run the program, the values are wiped out as the property is set to Nothing.In order to allow my property to be edited and saved, I realize that I must initialize the list and have done so in the accessor method of the property (if the property's value is nothing).

I have modified the values in the designer and placed a breakpoint on all of the items which use the property and it's underlying field, as well as on the property's methods itself. The first breakpoint hit is of it being accessed and the value is always nothing.

I'm not sure where the values are supposed to be stored as I have checked the designer code where it would normally store types such as strings and I have checked the resources to see if they have been saved there (like an image would be). After running the code, the values in the designer are wiped out also.

[Code]...

View 1 Replies

Using A SplitContainer On A UserControl At Design Time?

Jul 27, 2009

I'm creating a usercontrol with a splitcontainer. I can reposition the split when running, but when designing on a form I can't adjust the position graphically, I can only do it by typing a new SplitterDistance. Is there a way to get a grip on that position at design time?

View 10 Replies

Asp.net - My Custom Server Control Is Generated As System.Web.UI.UserControl In The Designer File?

Feb 16, 2012

I created a server control which consist only of fews buttons.

CWNavigation.vb
<ToolboxData("<{0}:CWNavigation runat=""server""></{0}:CWNavigation>")> _
<DefaultProperty("Id")>[code.....

I then referenced it in my ASPX page. Take note that the control are in the same solution, same project located in Commun/Navigation/CWNavigation.vb.

<%@ Register TagPrefix="NAV" TagName="CWNavigation" Src="~/Commun/Navigation/CWNavigation.vb" %>

I added it to the page.

<NAV:CWNavigation ID="CWNavigationService" runat="server" />

But the designer file along with the code-behind generate it as.

Protected WithEvents CWNavigationService As Global.System.Web.UI.UserControl

View 1 Replies

Passing Parameters To Usercontrol In Design Time?

Jan 10, 2011

I'm developing a form with usercontrols which have to be edited during disign.The project has a connectionstring in de my.settings.The usercontrol has a property which is also called connectionstring.Now, I want to pass the project connectionstring to the usercontrol connectionstring, when the usercontrol is dragged to a form. (All during design)

View 2 Replies

Graphic Designer Vs. Programmer To Design GUI (WPF Issue)?

Aug 26, 2009

In my friends company the management brought up the topic of moving in the WPF to design rich UIs. Majority of the employees of the company are programmers and only 3-4 graphic designers. The management wants to train the graphic designers with WPF so that their graphics skills could be applied in creating UIs. However, programmers have a mighty obligation for this. They have written several complaints to the management that WPF is not just Graphics but it has programming in XAML. SO the programmers wants to take over UI design as well (in the past programmers did the UI part as well)...... I'm a programmer therefore i'm with the programmers.

What would be the most suited solution for my friends compnay, should they move the graphic designers the WPF or should they train the current programmers to design UIs in WPF?

View 1 Replies

Modify Designer.vb (form Designer) To Remove A DataSet Control From Winforms Windows?

Jan 27, 2011

I am attempting to update an existing winforms application, that was created with a dataset control on all the winforms pages. I have ported it from VS 2008 to VS 2010 and I need to update the database section and connect it to the SQL backend using traditional code method.In the Solution explorer, when I click on the Dataset files, and click "Exclude From project" I am unable to build the project.Is it advisable to comment out the code lines that refer to the dataset in the .designer.vb files?

View 1 Replies

C# - Why Are Many Designer Classes In System.Design Marked As Internal

Aug 28, 2009

I have been developing some components for our products at work, and one of them is based off the flow layout panel.What i would like to do is provide a custom designer for it, but without loosing the features provided by it's default designer (System.Windows.Forms.Design.FlowLayoutPanelDesigner) which is marked as internal.Using Reflector i thought i would just implement it again myself, seeing as it inherits from 'FlowPanelDesigner and that from PanelDesigner` all of which are internal.

Why would these classes be specifically marked as internal? Is it due to them being specifically for Visual Studio use, and thus not 'framework' code?Also, is there an easier option that re-implementing all the functionality?

View 2 Replies

[2008] TabControl On UserControl - Adding Tabs (Design-time)?

Dec 2, 2008

I have a TabControl on a UserControl. I want the UserControl to behave like a TabControl as usual (it contains only the TabControl and a Contextmenu), including Design-time behavior.I have spent the last two weeks finding out how to add the Design-time behavior and I think I have come a far way.The problem is with adding TabPages during Design-time (while the UserControl is a custom tabcontrol, it is using regular windows forms TabPages).In the Designer class, I have the following code to add a TabPage:

vb.net
Dim dh As IDesignerHost = DirectCast(GetService(GetType(IDesignerHost)), IDesignerHost) If dh IsNot Nothing Then Dim i As Integer = tc.SelectedIndex Dim name As String = GetNewTabName() Dim tab As TabPage = TryCast(dh.CreateComponent(GetType(TabPage), name), TabPage) tab.Text = name tc.Controls.Add(tab)

[code]....

So it would add the control to the TabPages collection if it was a TabPage, and use the regular routine otherwise.

(I'm now using 'tc.Controls.Add(tab)' again instead of 'tc.tabCtrl.TabPages.Add')

But, I don't think the designer even gets that far because it is telling me I cannot add TabPages to my usercontrol, because only TabControls can accept TabPages... How can I make my usercontrol understand that it is a TabControl (without Inheriting from a TabControl?)

View 3 Replies

VS 2010 Properties Set During Design-time Are Not Serialized To Designer File

Aug 22, 2011

I am creating a UserControl with rich design-time support that should eventually look like the Options window in Visual Studio (or many other applications). Basically a split container, to the left is a TreeView with 'option categories', and each node in the treeview corresponds to a 'panel' to the right with certain options.

Just for terminology, the nodes in the TreeView are OptionsNode objects, the panels (containing the controls that determine the options) are OptionsPanel controls. My UserControl itself is called OptionsView and is the control that contains the treeview as well as a panel that contains the OptionsPanels.

I have some experience in design-time coding, and I have gotten pretty far. The OptionsView control contains a property Panels that returns the ControlCollection of the right side of the split container. The user can add/remove OptionsPanels via this property (and automatically an OptionsNode is created). The property uses a custom CollectionEditor that tells the designer to create instances of type OptionsPanel (instead of just Control which is the usual collection type of ControlCollection). Furthermore, in the CreateInstance method I use the DesignerHost object and its CreateComponent method to create the panels, instead of just creating New OptionsPanel objects. This way the OptionsPanel created is selectable and editable (via property grid) during design-time:

vb.net
Protected Overrides Function CreateInstance(ByVal itemType As System.Type) As Object
If itemType Is GetType(OptionsPanel) Then

[Code].....

View 1 Replies

C# - Design A Simple Label Designer That Could Print Labels For Shelf Items

Feb 23, 2010

I need to design a simple label designer that could print labels for shelf items, just like in a grocery store. The requirements are that the label shall contain a name, a barcode (e.g. Code39 symbology), price and room for some extra text.

[Code]...

View 2 Replies

VS 2005 - Designer Error - Exception Of Type System.ComponentModel.Design

Apr 26, 2012

When I attempt to open forms in the designer in the IDE, I get this error:

Exception of type System.ComponentModel.Design.ExceptionCollection was thrown.

My project is building OK. Any ideas?

View 9 Replies

IDE :: VS 2008 IDE Form Designer Will Not Render Form In The Designer?

Mar 30, 2011

My self and most everyone else on our team is having the same issue with VS2008. The designer will not render many forms in designer mode. Currently I am getting this error "The type 'Team.CAD.UI.My.Resources.Resources' has not property named 'view_16'" Well veiw_16 is in the resouces file.

View 2 Replies

App - Added The Form Class Code And The Designer Code

May 25, 2009

I've been working on a project the last couple of day with the help of a lot of you out there. I've more or less finished the design of the interfase, but there are stange this happening with the form. I can say much about what is wrong because I dont understand it, but I would like to. I have added the form Class code and the Designer Code, is that enough or is more required? Theres a msgbox that popup in the form Load event which I placed there to see what I could learn about the GraphicsBuffer.

Imports System.Drawing
Imports System.Drawing.BufferedGraphics
Imports System.Drawing.BufferedGraphicsContext

[CODE]...

View 1 Replies

Adding Items To The Collection At Design Time , There Is No Code Generated In The .Designer File?

Mar 17, 2009

i have created my own custom propertythe property is of type collection ,it displays a form which allow the user to add a list of images and strings,it stores the data in a collection ,my problem is , i have noticed that after adding items to the collection at design time , there is no code generated in the .Designer file of the form and there for when i close the for / save it and reload it , all the items that i added to my custom property are gone.my question , what did i miss here ? how do i make my custom property generate code at the .designer file for the items i have added to my property?

View 1 Replies

Set A Form's Location In Relation To A Picture Box In Another Form?

Sep 29, 2010

I have created a form with pictures of plants on it (note these pictures are moved to the left when the left button is pressed). When a mouse is placed over or hovers over one of these pictures i want a mini form to pop up beside the plant with the plants name on it.

[Code]...

View 3 Replies

.net - RaiseEvent From A UserControl That's Placed On A UserControl That's On A Form?

Jul 11, 2011

I have a Windows Form that contains a custom control container as a UserControl. For the sake of this question, this custom control container is called Dashboard. This container called Dashboard contains numerous other controls depending on their permissions. I need to raise events that are contained on these controls through the Dashboard control and over to the Windows Form.

How can I bubble up the event? I'm using VB.NET for this project, but can convert C# into VB.NET.Also, to complicate matters, the main Windows Form is a VB6 project. So, I'm using the InteropFormsToolkit to accomplish this.

View 1 Replies

Get The Form Position In Relation To The Screen?

Apr 16, 2011

I have this code working fine , it takes pictures of the correct size and correct file name , however , all the pictures it takes are in the top left corner of the screen , rather than where i have the form to. FYI the picture box in the middle has no picture in it , and is transparent , i want to save a bitmap of the contents of the picturebox ( a user defined size of the screen). The picture box and button are docked so that the form scales properly when being resized.

[Code]....

View 4 Replies

Address A Specific Control That Is On UserControl?

Jan 9, 2009

How do I address a specific control that is on a UserControl? For example, I have a UserControl containing a TextBox, that I add to a form in code. Now I want to set the text of that TextBox, but I'm not sure how to do that.

View 1 Replies

Form Design - Cannot Expand Vertically In Design View

Jun 27, 2011

I seem to have reached a limit on the size of the form. I cannot make the form longer and I need to add more fields. Is there a limit on how many fields can be included in a form?

View 1 Replies

Expose A UserControl's Properties To Properties Window In Designer?

Aug 19, 2009

Is there a way to expose a UserControl's properties to the Properties Window in the Designer?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved