I'm working on an application which has a common window hierarchy with menus and worked ok on vs2003, but now I'm on VS2008 sp1 trying to generate the same hirarchy and I'm amazed that visual support for differents controls like the menustrip are not working. I've been investigating, and so far it seems that the answer to my question is "it's not supported".
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.
I have two Forms, which have similar Functionality (i.e. an amount of similar Controls) but complete different Layout. So the normal inheritedForm (which VS2010 provides) wont work here.
I have tried following:
Public Class BaseForm Inherits System.Windows.Forms.Form Friend WithEvents Button1 As System.Windows.Forms.Button
[Code].....
So it looks like, the Designer only tries to guess how the Form looks like by inspecting the top-most Class, without compiling the full inheritance-Tree...
I'm developing a VB app, part of which has a 'diary page' metaphor. The page is a panel and I want to put be able to put several different kinds of events on the panel. I've used a User Control for the first type, which works well, and it occurs to me that this and the other events have many properties and methods in common.
So I am wondering if it is possible or desirable to create a 'base' user control with the common properties and methods and have the other events inherit from that? (I am using the word event in the sense of a meeting or workshop rather than a Windows event).
I know one can do Visual Inheritance from a form and I've made a first attempt at applying the same process to my User Control, but when I open the 'inherited' control in the designer, all the properties are disabled and child controls are locked, even though the access modifier is 'Protected'. But I am still feeling my way with inheritance and I'm probably doing something dumb ...
Another approach would be to use MDI, but that feels a bit 'heavyweight' for this app ....
I am trying to create an infrastructure library to be used by all my projects where one of the project in that library contains the base forms for different things like ViewBase, EditBase, SearchBase & DialogBase. They all are inherited from a Base form which contains a toolstrip control with 3 common buttons for OK, Close & About.Now depending on the type of base form I would like to add few more buttons and controls on the toolstrip during the design time. For example the SearchBase would have a Search, Clear buttons and so forth and so on.
Why is it that some components/controls will not be inherited visually in a child form if they are declared with the access modifier Friend vs when they are declared with Protected. For example, I've got a DataSet object in my Parent Form that was initially "Friend" (I drag and dropped it to the form, so it was shown as a control in the designer view), but I noticed that my Child Form did not inherit the control as expected. Once I changed it to "Protected", it showed up in my Child form as expected.I am aware that Protected allows the Child Form to modify the inherited control, but how exactly does this tie in to the issue I described above?
I have 4 WinForm app. Form1 inherits from baseForm, Formv2 inherits from Formv1, v3 from v2, v4 from v3. There are about 2 thousand controls spread across many tabs that contain tabs.
This is really killing Visual Studio 2008, frequently causing it to crash, and just terrible performance in general.
I want to create a FormV5 that inherits only from baseForm but contains all the visual layout of formsv1 through v4 (all of them), (there are no controls on baseForm).
The differences from form to form are mostly adding new controls, with some older controls having to be moved or hidden, and or a few labels changed here and there.
Someone asked me today if it was possible to port a visual basic application to Linux or similar platform, I assumed it was .NET so I suggested to use Mono, but noticed that on their vb support page they only talk about vb 8 (.NET) Does mono support non-.NET vb? In fact I'm not sure what he is using, I think vb6, I'm not sure of the versioning at all though.
The full error text is as follows: The Visual Studio language support for VB has not been installed. Code-editing IntelliSense will not be available. Markup IntelliSense for server controls may not work.
I am using Visual Studio 2008 Professional Edition. Visual Studio crashed yesterday and now I'm getting this error when I try to edit any code-behind in any project.I have tried resetting all environment settings and that didn't work.I have tried repairing my installation via add/remove programs and that didn't work.
I have tried reinstalling SP1 and that didn't work.I tried creating a new VB Windows project and received the following error: Project "TestVB" could not be opened because the Microsoft Visual Basic 2008 compiler could not be created. Please re-install Visual Studio. However, I already tried the repair/reinstall.
I'm not sure what else to try beyond a full uninstall/reinstall, and I'm hoping somebody has encountered and fixed this problem without having to do that.UPDATE: I have tried uninstalling Visual Studio, rebooting and then installing again and that didn't work. I am now out of options and really need my VB environment restored.
I found that this answer was asked and answered before VS2010 was actually released.[code]to a .NET Framework 4.0 project in Visual Studio 2010 and it does not compile.Do you now if this feature is really implemented and what I am doing wrong?
I'm running the string on "Can I run a VB.net application on a website"Nothing seem to work after trying to install web developer, it would not install. So i uninstalled VB express and tried to install Visual Studio 2008 which did not successfully install so I tried 2010 and still nothing. Why am I having problems installing Visual studio? Also I cant install windows xpsp3? error messages says not compatible?
I want a menu with just two dropdown lists, the menustrip puts a strip right across the form, is there any way to change the width of the strip? Changing in properties does not work. Is there a different type of menu I can use?
I compiled some VB6 code on my Win7 x64 machine and the result .exe will not run correctly on any other machine. VB6 code is just a new template .exe file with one button, a reference to "Microsoft ActiveX Data Objects 2.6 Library" and the following code in the button press event: Dim db Set db = New ADODB.Connection It runs correctly on my machine, but no others (even other Win7 x64 machines) (Update: I found TWO other users where it runs and one of them is Jeff Atwood!, but most machines have the same problem)
we have 3 classes:Class S, class A, class B / A and B inherits S.A has a property A1 and B has a property B1.we also have a collection of objects that has A and B objects.ex.
Dim c as Collection = new Collection c.add(new A) c.add(new B)
Now we want to make a general object that will read from the collection.
ex . Dim obj as S
how can we cast obj in order to see properties A1 or B1 according to the class;
Form1 Public Class Form1 Private Sub But_Bell_Click(sender As System.Object, e As System.EventArgs) Handles But_Bell.Click MessageBox.Show("Ding a ling") End Sub
[code]....
Where has the whistle button gone? The class part of the inheritance has works because you can access it via code.
I'm facing a problem regarding multiple inheritance in VB.net:As far as I know VB.net does not support multiple inheritance in general but you can reach a kind of multiple inheritance by working with interfaces (using "Implements" instead of "Inherits"):
Public Class ClassName Implements BaseInterface1, BaseInterface2 End Class
That works fine for classes but I'd like to have an interface inheriting some base interfaces. Something like that:
What are the situations and their associated benefits of using Generics over Inheritance and vice-versa, and how should they be best combined?I'm going to try to state the motivation for this question as best I can:I have a class as shown below:
[Code]...
Now suppose I have a repository that takes an InformationReturn argument, that has to strore different fields in a DB depending on the type of Info object T is. Is it better to create different repositories each for the type T is; one repository that uses reflection to determine the type; or is there a better way using inheritance capabilities over/with generics?
I have a base class ("MyBaseClass") in a project called "BaseFramework" which is included in several solutions within the company. There are several derived class's in various projects throughout the company that inherit from "MyBaseClass". If I then create a List and add derived class's to it, it will not serialize. I realise that if I were attempting to serialize this list, and the base class and derived class were in the same project, I could simply apply the "XmlInclude" attribute to the base class and include all of the derived class's. This is however not possible across projects, because that would require a circular dependency.
I have the following code; now i set a propertygrid.selectedobject to the Square object, and start changing the Squares properties. If i change the [Position.x] or [position.y] values in the propertygrid the [Position] and [center] properties update correctly, however when i change the [Center] property, neither [Position] or [Position.x] or [Position.y] update. Is there something else i must do to get this to work both ways. Maybe something is lacking in PointFConverter?
Imports System Imports System.Collections Imports System.Drawing
Suppose I want to inherit from System.Data.SqlClient.SqlTransaction which is sealed. Supose I want to just put a wrapper around SqlTransaction and always use MyTransaction instead of SqlTransaction. Is there a way I could potentially cast MyTransaction to SqlTransaction using an Implicit/Widening operator?