Make Subroutines / Properties Inactive In Classes?
May 27, 2010I am working on a bitmap class module in Visual Basic 2010 that has an option to create a graphic grid on the bitmap.
[code]...
I am working on a bitmap class module in Visual Basic 2010 that has an option to create a graphic grid on the bitmap.
[code]...
I want to know what are classes , objects , a namespace , subroutines,functions,methods,properties and differemce betweem byval and byref in your words.
View 18 RepliesI would like an overview of System.EventArgs. I have an understanding of System.Object where I can pass data between subroutines and functions using Public Classes. I am curious what EventArgs do?
View 3 RepliesI have two classes, one nested in the other. [code]Neither "Name" or "ID" are unique between operations and records.I wish to construct a dictionary using LINQ = Dictionary(Of String, Of List(Of Integer), whereby the keys are uniqe examples of Names in my collection and the values are the collective set of distinct IDs that are associated with those names.
View 2 RepliesI am making a "fake Operating System" or "Virtual Machine" or what ever you want to call it. It has all of its own programs. I want Windows XP to stop running so that it will go faster and so on.Okay so I will obviously need coding on the Form1_Load and Form1_FormClosing Subs.Here is my attempt at coding it (Note that this is just the attempt at coding this particular part. It is not necessary to give you everything cause it would be to much and it might confuse people) :
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
System(My.Computer.FileSystem.Drives.Join)
End Sub
[code]....
so far i got
code
For Each item As Reflection.FieldInfo In GetType(NameSpace.ClassWithNestedClasses).GetFields
rtfAppend(item.Name & ":" & Tab & item.GetValue(Me))
Next
For Each item As Reflection.PropertyInfo In GetType(NameSpace.ClassWithNestedClasses).GetProperties()
[code]...
which gets me the simple string vars and properties of my top class, but how can i apply this to loop through all sub classes and get there vars and props?
I want to be able to make an internet window (its a java game in a popup) that are "active" or even "inactive" all time.In example: I'm opening a MSN chat window, in the game a symbole next to my name changes to "ZZ", what i want to do is to make this "ZZ" won't appear
View 24 RepliesI have Form Class A, which is the "Main Form". An Event fired by Form A instantiates Form B, and sets Form A as it's owner. (which makes it be on top of FormA at all times)[code]...
View 4 RepliesAccessing Properties Of Form Classes
View 1 RepliesLet's have three classes;
Line
PoliLine
SuperPoliLine
[code]...
Seems like you should be able to Suppress Properties in inherited classes. How do you do it?
View 7 Replieswhat I would like to do is create a class that has a few private properties and one public property.the end result of the class is to return a list(of servers)below is what I am thinking. My brain just can't come up with the correct answer.
namespace sample
Private _servername As String
Private _farmname As String
[code].....
I have two custom attributes defined like so:
internal class SchemaAttribute : Attribute {
internal SchemaAttribute(string schema) {
Schema = schema;
[code]....
I would like to restrict the SchemaAttribute to classes, and the AttributeAttribute to properties.Is this doable?
I am a vb.net newbie, so please bear with me. Is it possible to create properties (or attributes) for a class in visual basic (I am using Visual Basic 2005) ? All web searches for metaprogramming led me nowhere. Here is an example to clarify what I mean.
public class GenericProps
public sub new()
' ???
[Code].....
You know how everyone says "C++ is like C with classes"?How similar is it to .NET classes? instance a class, based on other classes, add new properties, override existing properties, etc?Are the variables strongly-typed and declared before they are used? Or is it a Duck-Typing language like Python?
Also, does it have its own Garbage Collector that disposes of objects when the pointer exits their scope,or do you have to manually clear and get rid of them when you finish with them? What's the difference between native C++, and the "managed C++" in Visual Studio? Because I'd prefer to use native code if its not too much harder. for the sake of all that is good and holy, don't use ACCESS, EXCEL, or a TEXT FILE as a database. If you want your program to use a "local database", without any of the hassle of setting up a MS SQL or MySQL server, just click this link: >>> SQLite <<< Seriously. This is for your own good.
Sorry if this is a bit random, but is it good practice to give all fields of a class a value when the class is instanciated? I'm just wondering if its better practice to have a constuctor that takes no parameters and gives all the fields default values, or whether fields that have values should be assigned and others left alone until required?
View 4 Replieswhat's a Class, and Object, a Method, a property and thins like that, but I have this doubt:Let's supppose I have a class "Laundry" this class has (just for this example) 3 propierties:
1.- laundryID
2.- Name
3.- Washers
Id and Name are "primitive" types or simple types (integer and string), but Washers, represent a list of object of type "Washer", that has 3 properties:
1.- washerID
2.- laundryID
3.- capacity
4.- brand
All of them (for this example) simple/primitives types (integer,string,string).So this my dilemma, it is correct to have a constructor like this (VB .net)
public sub new(ByVal laundryID as integer)
'' Here I'll query for the data of the Laundry on DB
'' After that I will query for every washer that belongs to this laundry
[code]....
And inside of that constructor query for all the washers that belongs to the laundry with id=laundryID parameter, and create objects of type "Washer" and add them to the list of Laundry ?I'm not sure If I explain myself, any comment I'll be really grateful, in less words, what's the correct approach (or good practices) to work with class/objects that has properties which are complex (other class/objects).I usually work with ADO.net probably ADO/LINQ/Entity solve this thins in an transparent way, but if they do it I don't really know it.
Note: I'm familiar with VB.net, C#, PHP, so if you prefer explain/help me using examples with its syntax, it's ok
[code]I want to make the Properties Window to update the properties for X and Y at each MouseMove, so they become immediately visible for the user.
View 2 RepliesBackground:I have a base class and several inherited derived classes. The derived classes don't always need to have the same properties. If any properties are shared among the derived classes, those properties would live at the base class level ('Contents', for example).Similarly, GoodDocument below has 'GoodThings' but would not want/need to have 'BadThings'.I want to treat instances of both 'GoodDocument' and 'BadDocument' as type 'Document'
public mustinherit class Document
public property Contents as string
public sub new()...
[code]....
I am trying to implement a sub-class as a property of another class. Eg:
[Code]...
I've often wondered why would you need to make your own classes in vb.net? What purpose can they serve a typical application that cannot be already down without creating them?
View 2 RepliesSo i learned about classes today and i am totally confused about them. How exactly do they make programming life eaiser? I though Functions and Sub Procedures were making my programming life easier
View 4 RepliesI'm trying to create a base interface for a class of mine that uses generics. However, I cannot figure out how to declare a property of the interface when its type won't be defined until the class is initialized.
To clarify, consider List(of T), which according to msdn, implements IList (among other things). Note that IList is not the same as its generic counterpart IList(Of T). So that mean any List(of T) can be converted to IList, which simply returns an object for its items. That's what I want to do with MyClass(of T), be able to cast it as IMyClass regardless of what T is.
But when I try such as:
Interface IMyClass
Prop A as Object
Class MyClass(of T) Implements IMyClass
Prop A as T Implements IMyClass.A
I get a signature error for the last line, even though object is broader than T. What am I doing wrong, or how exactly did Microsoft manage to make List(of T) implement IList?
This probably sounds daft, but im struggling to get to grips with Classes/Modules/arrays and objects, as well as there uses and what they are, and yes im still coding some how i hear you cry.The reason i ask is because Ive got a load of Dim's in my program that are the same giving locations of files and folders and wondered can they be used as a module that i can alter after the program is built, incase of folder locations being wrong or moved, manually correct after install.
View 1 RepliesWe are using T4 to generate our .aspx and .vb files. Everything works well - but we often have to customize behavior on the pages. However, we also occasionally have to regenerate pages - which has the potential to wipe out work which would otherwise still be valid. I would like a setup like this:
Default.aspx 'which would contain the controls
Default.aspx.vb 'which would bind, load and save data
Default.behaviour.vb '(or something like that) - which would store the behavior
With both the pages being able to reference the controls. Is that at all possible? [Code]
I was just wondering how you can make classes import into your main Form.vb
Let's say I make a class with the following.
Public Class OtherStuff
Public Sub HideMe()
Form1.Hide()
[Code]....
How could I make the Form1.vb include the things that are in OtherStuff.vb.
All of the solutions that I have tried come up with the same error. Reference to a non-shared member requires an object reference.
I have written multiple programs in the past that deal with cad data. Points, lines, arcs, etc. For each program I ended up creating slightly different versions of some really base classes like a class that defines a point:
<Serializable()> Public Class Point
Public x As Double = 0
Public y As Double = 0
Public z As Double = 0
End Class
My question is how would I use that class in such a way that it could be in a namespace and imported into any future project that I write?
How can I make inactive textboxes / Richtextboxes autoscroll? I have Multiple richtextboxes that are constantly being appended with data automatically and at the moment only the one that is active scrolls and all the others stop when the fill up. How can i get round this?
View 3 RepliesI am having trouble creating inactive users in VB. I watched the tutorial [URL]but it is for C# and the code behind won't work in VB. I need the users to be inactive when they register and send the administrator an email saying someone has registered to be approved.
View 3 Replieshow I would make hotkeys e.g "ctrl + 1" to do an action even when the application ism't the active window.
for example I am working on photoshop and then i press ctrl + 1 and my app appears in front of it.
or if I press "ctrl+2" a new window will open.
I need this to also work when the application is hidden and in the system tray as well as when application is visible