Exposing A Supporting Class From A Usercontrol

Apr 8, 2010

I have a supporting GridColumn Class that resides in the same class library project as my GridBox usercontrol.It is used in a list of GridColumns as a property.[code]In the Load event of my form I would like to use the .Add method of the List(Of GridColumn) to add columns to the usercontrol.[code]It will not work though because it cannot find the GridColumn class.If I use: "Imports <My Class Library Name>" it works, but I would like it to work without having to do so.Standard controls do this all the time.Am I putting the supporting class in the wrong place?Is there a modifier I that will expose the class when the usercontrol is dropped on a form?As a work around I created a method that adds a column but I would like to know in any case.

View 9 Replies


ADVERTISEMENT

Exposing A Class Through Another Class With Consistent Naming In .net

Jul 15, 2010

In the pseudo code below, if I have two classes and I want one class to be initialized in the other class without the name having to be different, how would I accomplish this?

'==Car.vb==
Public Class Car
Public Model as New Car.Model()

[Code]...

Is there a better way of doing this so I get the result I want for my usage code?

'==ASPX page==
Dim c as New Car()
c.Model = Car.Model.Types.BMW

View 1 Replies

WCF Service Generated Proxy Class Exposing Function As ByRef Sub

May 23, 2011

I have a WCF Service exposing a single contract and operation:

<ServiceContract(Namespace:="ImageSystem")> _
Public Interface IUploadService
<OperationContract()> _

[Code].....

This subsequently leads to stream casting issues, because the generated function allows me to pass a memory stream as an input (which works correctly when passed through to the service), but instead of passing me back a new stream for the response, it attempts to cast the MessageBodyStream received from the service into my memory stream.

This is, in some ways similar to other posts but as you can see, there are no enums involved in my contracts - presence of Enums caused strange proxy class generation is marked as the answer in the similar post.

Is there anywhere I configure the proxy behaviour to use the contracts I've specified? Clearly I'm within a dev/test environment currently, but when this eventually goes to production it will be memory and file streams passed to the service, and the returned stream can be in any format to be honest, I intend to treat it as the abstract stream class. The only way round this I can see right now is to change my in stream to be the same as the anticipated out stream, but surely there is a better way?

View 1 Replies

VS 2010 Structure Classes So That The User Interfaces Though A Single Class While The Supporting Classes Are Hidden From Their View?

Jun 13, 2012

How can I structure my classes so that the user interfaces though a single class while the supporting classes are hidden from their view? I think its best understood in an example:

Public Class MyInterface
Public Economic as EconomicClass
Public Sub New()
MyBase.New()

[code].....

So you might ask why am I even separating them? It's strictly for others who will be working with this interface. I need to funnel them though a logical structure:

interface.Economic.MyMethod
interface.Currency.MyMethod
etc

This way everything is already handled for them in the background and they only need to run the method they need. I don't know if I can have it both ways in VB.NET.

View 23 Replies

Added To Each UserControl (different Instances Of The Same Class), A Little Map?

Apr 28, 2009

I have a form whose purpose is to let the user to load map files.The form may manage a variable classes of maps, and each class have his own UserControl.To make it more user friendly, I added to each UserControl (different instances of the same class), a little map, showing a small picture of the map, and some data, as bound coordinates.

The problem is, that it looks really ugly. The maps are so big, compared with the rest of the UserControl (who contains just a button and a textbox to search for files).I wish to fix it, but I din not see an elegant way to include the pictures and info.I attach a form screen capture with two UserControl.I would like to get some tips for more experienced users. There are some guidelines?

View 5 Replies

Reference A UserControl Class Based Off String Value?

Jan 24, 2011

I currently have the following [code]...

How can I modify it so that "UserControl_appName" is not hard coded. I would like to pass it as a string.

View 3 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

Listbox Does Not Supporting More Items?

Jun 23, 2011

I have a list box on which I am using a data source as a dictionary file data

Dim lines As New List(Of String)

[Code]..

View 9 Replies

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

.net - Write A .NETCF Partial Class To Extend System.Windows.Forms.UserControl?

May 28, 2010

I'm writing a .NET CF (VBNET 2008 3.5 SP1) application, which has one master form, and it dynamically loads specific UserControls based on menu click, in a sort of framework idea. There are certain methods and properties these controls all need to work within the app. Right now I am doing this as an Interface, but this is aggravating as all get up, because some of the methods are optional, and yet I MUST implement them by the nature of interfaces.

[Code]...

View 1 Replies

Error - Base Class 'System.Windows.Forms.Panel' Specified For Class 'MenuButton' Cannot Be Different From The Base Class 'System.Windows.Forms.UserControl'

Mar 12, 2010

When I do this

Public Class cInherits : Inherits Panel

I get this: Base class 'System.Windows.Forms.Panel' specified for class 'MenuButton' cannot be different from the base class 'System.Windows.Forms.UserControl' of one of its other partial types.

How do I inherit?

View 4 Replies

VS 2005 Supporting Multiple Foreign Languages?

Jun 4, 2009

It looks like the next version of our application is going to have to be multilingual. People may be using it in Israel, Singapore, Japan, and who knows what other places. Consequently we'll have to change our text in labels, on message boxes, etc. to match the language where the app is installed.I know, or at least I think, that there are features built into the .net framework that can assist with this, but where is a good place to look for documentation or guidance as to what to use and what sort of design considerations to address?

View 2 Replies

VS 2010 Application Development - Supporting Two Types Of Databases?

Apr 27, 2012

I want to design a application which can support two different types of databases same time e.g; when we install, it will ask which db it has to support and based on initial selection it should work with any db without changing anything in the application.In short it has to be developed keeping in mind that user may have either MS SQL or MySQL. It should support both.

View 4 Replies

RE Exposing COM Interface To .NET?

Jun 29, 2010

Is it possible to create a VB6 interface that can be implemented in a .NET class? I have the need to call a method in an existing VB6 class that behind the scenes will call either a VB6 or .NET class that utilize the same interface.

MyObject.Type = "clsVB6"
MyObject.DoSomething(intID)
would behind the scenes be utilizing a VB6 class that implemented a 'DoSomething' VB6

[code]....

View 2 Replies

How To Manage Different Releases Of Supporting DLLs In Visual Studio 2010

Nov 18, 2011

I have a VB.NET/C# Visual Studio 2010 Solution with a bunch of projects that depend on about 30 third-party DLLs all from 1 vendor. This third-party vendor recently released a new version of their software so I would like to parallel test their new software and my enhancements until I am comfortable to switch over. What is the best way to setup a solution in Visual Studio 2010 so that I can use the code I have developed on top of these third-party DLLs and have the opportunity to easily switch between:

(1) the new version of the third-party DLLs [for my testing] and

(2) the old version of the third-party DLLs in case I need to debug some problem a user is having.Third party assemblies ARE NOT in GAC (they're currently in a folder on a network drive). They are NOT strongly signed (ran sn -vf ). They are changing from version 5.4.618.0 to 5.4.619.60.

View 3 Replies

VS 2010 : UserControl MouseEnter/Leave Events Aren't Firing - Cannot Raise Base Event From Derived Class

Feb 18, 2011

When i use my UserControl in a project my Mouse Enter & Leave events aren't firing, i assume i fix this with a raiseevents in my usercontrol. However when i try to do this it says something about "cannot raise base event from derived class".

View 7 Replies

.net - Error Exposing Event Through Interface?

May 19, 2010

I have this interface

Interface IProDataSource
Delegate Sub DstartingHandler(ByVal sender As Object, ByVal e As EventArgs)
Event starting_Sinc As DstartingHandler

[Code].....

View 2 Replies

C# - Exposing Property As Variant In .NET For Interop?

Feb 28, 2012

I am creating a wrapper class in .NET (VB.NET as it happens but is equally related to C#) that is exposed to COM and one of the properties I am trying to wrap is a Variant. I thought I would just be able to use an Object, but I get an error: Public Property FieldValue([vFieldID As Object = -1]) As Object cannot be exposed to COM as a property 'Let'. You will not be able to assign non-object values (such as numbers or strings) to this property from Visual Basic 6.0 using a 'Let' statement.*

My property declaration looks like this:
Public Property FieldValue(Optional ByVal vFieldID As Object = -1) As Object
Get

[code].....

View 2 Replies

Exposing An Enumeration Through COM That's Declared In A Different Module?

Mar 15, 2011

I have a .NET library that needed a COM wrapper around it so it could be called from VB6ish programs, in this case specifically Microsoft Access XP I have a type that's declared in one of the classes that went into the .NET library. I thought since its public, it would be seen, but it didn't show up in Access. And yes, we made the TLB file and registered the COM interface. I had to move the type declaration into the COM module, which I really didnt want to do. Is there a way to export a type/enum through COM without actually declaring it in the COM interface Scott Berger McCormick Systems

View 3 Replies

VS 2010 : Exposing An Instance Property As Shared?

May 24, 2010

Suppose I have a class of objects called Porky with a property called IsHuge:

Public Class Porky
Public Property IsHuge As Boolean
End Class

Now I want to make a special kind of Porky -- let's call it UberPorky -- for which I want to change ALL instances to either IsHuge or not IsHuge. What I'd like to do is this:

Public Class UberPorky
Inherits Porky
Public Overrides Shared Property IsHuge As Boolean

[code]....

The trouble is, I can't do that. I'm not allowed to reference MyBase or Me in a Shared property.

View 17 Replies

VS 2010 Exposing Picture Box Drawing Surface?

Dec 27, 2010

studying GDI+ for drawing, there are many suggestions to expose the graphic surface for the paintbox control or a form using e.graphics in the paint event. Can graphics be exposed outside the paint for the picture box control?

In my old vb6 project that I am converting to vb.net 2010, I have several large routines located in a code module that draw lines, circles, etc on a picture box and it is desirable to keep these outside the paint event of the picture box so the same routines can be used to draw on more than one picture box.

In experimenting, I found I can create e.graphics from the picture box paint event and pass it by reference to a drawing routine and the drawing routine seems to work ok on initial experiments but it requires visiting the picture box paint event to get the drawing surface in the external sub.Is this apprach good programming practice or is there a better way to create the graphics surface of a picture box or form in subroutines outside the paint event?

View 1 Replies

C# :: Call Function From UserControl On ASPX From UserControl On MasterPage?

Jan 31, 2011

I have MainLayout.master that has UC_Menu.ascx on it. I have a page named Customer.aspx that uses MainLayout.master. Customer.aspx also contains a UserControl named UC_Details.ascx.How can I have UC_Menu.ascx call a function that is in UC_Details.ascx with this scenario?

View 3 Replies

Compiling And Running Code Dynamically / Exposing Objects From App

Jul 19, 2011

I am trying to add some scripting to my VB.NET 2010 Windows Forms Application.I have figured out how to compile and execute VB.NET code stored in an external script file from within my app using Microsoft.VisualBasic.VBCodeProvider.CompileAssemblyFromSource and InvokeMember. I can also pass and return parameters to the code in the script file.In VB6 using the VBScript Host control, I could expose instances of objects in my app to the code in the VBScript.How do I do this in VB.NET?I'd like to expose a form object (the main form for my Windows Forms Application) to my VB.NET script.I don't want to pass the form as a parameter via InvokeMember.[code]

View 3 Replies

UserControl Access To Public Properties In Another UserControl?

Jun 12, 2011

I have a Windows Form frmMain() holding seven more-or-less unrelated UserControls, ucFlopsy", "ucMopsy", "ucCottontail", etc...I say "more-or-less" because each of the seven UC has three similar public read/write properties:

IsLocked (a boolean indicating if the following two properties are "Locked")
IsLockedID (if IsLocked=True then IsLockedID is an integer)
IsLockedName (if IsLocked=True then IsLockedName is a string)

[code].....

View 1 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

Asp.net - Reference TextBox In One UserControl From Another UserControl

Jan 19, 2011

I have two UserControls on a MasterPage. DataEntryUC contains several TextBoxes and DropDownList. NavSaveUC contains navigation buttons. When the user clicks on a navigation button, I will be saving the data entered into DataEntryUC from the NavSaveUC UserControl.

I have a couple of tables in my DB that contain stored procedure names, control names, control types, SqlDbTypes, etc.... that correlate with DataEntryUC.

How do I reference a text box that is on DataEntryUC from NavSaveUC?

I have been working on the following code from NavSaveUC with no luck.

Dim MyControlName = "txtFirstName"
Dim MyControlType = "TextBox"
Dim MyStringValue as String

[Code]....

View 2 Replies

Setting Usercontrol Properties Within A Usercontrol

Mar 22, 2012

I have a usercontrol that has a main form and calls another form within the usercontrol to get some data from a database that allows the user to select some items from a CheckedListBox control on the sub form. I want to pass the selected items from the CheckedListBox back to the main form and display the results there. I have a public property called DBList of type List(of String) on the main user control. If I create a reference to the usercontrol form the second form within the usercontrol I get a new instance of a user control. All I want to do is set the property on the usercontrol and close the secondary form. How do I reference the usercontrol from the form within the usercontrol?

Code in UserControl:

Public Property DBItems() As List(Of String)
Get
Return DBItems

[Code]....

View 3 Replies

VS 2010 Load Data Into UserControl In UserControl.Load?

Sep 25, 2011

I just discovered the joys of UserControl's and I was wondering if it is possible to populate the usercontrol with data from a database in the UserControl's Form.Load event instead of the form the userControl is placed on. I feel it would make using the control a lot easier if it just populated itself without anymore code.I tried it with a ListView but it gave me a bunch of errors, so I didn't know if it had to be done a certain way or if it was just one of those things that doesn't work no matter what.

View 8 Replies

Class C Inherits Class D Is Class D A Superclass Or Parent Of Class C?

Dec 16, 2009

If Class X is within the scope of Class Y, is X a subclass of Y?If Class A is a sub Class of B, then is Class B considered a super class of A?if Class C inherits Class D is Class D a superclass or parent of Class C?if Class E extends Class F then we can consider Class E a child of F?if Class G inherits Class H and is within the scope of Class I then who is the parent of Class G? Classes that inherits Class J and classes that are within Class J are all sub classes of Class J?

View 1 Replies

Form Inheritance - Error1Base Class 'MenuStrip' Specified For Class 'Lesson2' Cannot Be Different From The Base Class

Apr 15, 2010

I have put this code in the global form Inherits System.Windows.Forms.Form. And then in the form that will inherit this from the global Inherits MenuStrip. "MenuStrip" is what the global form is called. But keep getting this error: Error1Base class 'MenuStrip' specified for class 'Lesson2' cannot be different from the base class 'System.Windows.Forms.Form' of one of its other partial types.

View 5 Replies







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