How To Create A Similar Structure
May 28, 2010
I'm trying to create an enumerable class, similar to System.Drawing.Color - My goal is to have places in the code where I can define a variable as the type of my structure, then be presented a list of static values to pick from.I'd also like to use this for a property of a UserControl.I don't know if I'm using the right setup here with the class, structure, etc.I'm just trying to mimic the Drawing.Color class.I'm creating a Public Class called Person.Inside it, I have two Public ReadOnly Properties for Name and Age, their corresponding Members, and a Constructor to create a new Person.Second, I have a Structure called Persons and it has two ReadOnly Properties: Billy and Sally.[code]In my attempt, I get the full freaking .net class library in my intellisense list. Using Drawing.Color, I get a nice pre-defined list of values to pick from.No extra methods.No constructors.Just values.
View 16 Replies
ADVERTISEMENT
Feb 11, 2012
I have an array of structures:
[Code]...
An array of the above structure with 30 element. I want to sum the empsal of those emp elements whose emp.empName & emp.empAge is equal.
[Code]...
View 2 Replies
Oct 28, 2010
I am using structures in my programming and I sort the structure according to a value in the structure using IComparer.This is a simple example for what I want.
Dim MyArray(6) As Integer
MyArray(0) = 1
MyArray(1) = 45
[code]....
How does number 1 get sorted? Is it brings the newest 1 to top or keeps the old 1in the same index? In my original example (before sorting), MyArray(0) = 1 and after sorting MyArray(0) = 1.Is this the same original 1 or this another 1 (the newest one added to the array) moved to that position?In case the MyArray(0) = 1 after sorting should be MyArray(5) = 1 before sorting.
Here is my a sample of my Code:
Public Structure ToSolve
Dim Con(,) As Integer
Dim Discharge(,) As Double
[code]....
Using all these methods, how can I preserve the positions of similar number in the list? i.e. I want to bring the newest 'Similar' value to the top of the list.
View 1 Replies
Jun 9, 2010
I am looking for some thing to create a line similar to the <HR> tag in HTML.
View 1 Replies
Dec 22, 2010
I would like to create a vertical slider similar to ones you would find designed in AJAX but I need to do it in a VB.NET Windows Form. I'm hoping that someone has seen this done.
View 5 Replies
Jun 21, 2010
I have a form in VB2008 with 3 panels, each containing panels. How can I copy the formatting to create similar forms to it?
View 1 Replies
Dec 6, 2010
This is for a WindowsCE project,
Windows WM6 does not allow you to hook in WndProc easily as this has been hidden, I've built a class that inherits from MesageWindow, which allows me to receive Messages as intended.
What I'm trying to do is create an event that will return a value Boolean bypassing base.WndProc(ref m);
basically saying I've handled the event it does not have to, similar to how the Form_closing event would work e.g e.Cancel will cancel he closing off the form.
I've not finished my WndProc function as of yet but you should get the picture.
Code:
public delegate void WndProcEventHander(object sender, WndProcEventArgs e);
public event WndProcEventHander OnWndProc;
protected override void WndProc(ref Message m)
[Code].....
View 2 Replies
Mar 23, 2011
I am trying to create something similar to the paint bucket tool in microsoft's paint, but using the code I created I get an infinate loop.
Imports System.Drawing.Imaging
Imports System.Drawing.Drawing2D
Imports System.Runtime.InteropServices
[Code]....
View 6 Replies
Sep 28, 2011
create a calendar program very similer to Outlook's Calender.But only on its own, i want it to be able to have multiple user access so several people can check eachothers calender obviously.But i have no clue where to start, doesnt have to be the exact same as outlook just have the same functionality.
View 1 Replies
Aug 11, 2009
I have gradient on a form set as follows in Example 1 below. I also have a custom panel which has its colour set as in Example 2. I want to get the same colour from Example 2 into Example 1. However I am not sure how to do this within example 1.
[Code]...
View 7 Replies
Jun 5, 2011
I'm trying to create a small paint component( similar to MSpaint but not the same thing) in vb.net.I have a panel that holds the background image and a picturebox over the panel that I draw on. I'm using graphics to draw shapes and I have my own custom double buffer, meaning that I draw on the picturebox while the mouse ismoving and on mouse up I draw the final image on the buffer image and on paint event the buffer image replaces the picturebox image.also, i have set the form properties to enable double buffering
Me.SetStyle(ControlStyles.ResizeRedraw, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.UpdateStyles()
my problem is that no matter what i've tried the picture box keeps flickering. as long as the mouse is moving, the paint event keeps getting called and the image flickers like crazy what i need is more ideas(or pseudocode) on how to avoid flickering.
View 3 Replies
Dec 16, 2009
We have migrated our Vb6 application to VB.NET using a third party tool. Now we are in a process of Refactoring and introducing object oriented concepts in the application.
In VB6, we were using structures in many places. As a part of introducing object oriented programming,
1. is it a good idea of changing all Structures to Classes? or Is there a concept of "Generic Structure" similar to Generic collections, Generic classes?
2. Can some one guide me any source containing guide lines or best practices for applications that are migrated to VB.NET from VB6 and implementing object oriented programmaing.
View 3 Replies
May 1, 2009
The more I read my book the more confused I get, as the programming example is not even close to what this assignment is I am to modify my existing project to keep track of an order in an array.
View 1 Replies
Apr 1, 2009
I am attempting to create a generic function that the students in my introductory VB .NET course can use to search a single dimension array of a structure.[code]...
My question is: Is there a way to reference the individual structure fields in the array from inside the function? I was trying to make it generic so that the student could simply pass their array into the function - their structure may be named differently than mine and the field names may be different.
I suspect there are other ways to deal with this situation, but I was trying to keep it to just a simple single-dimension array of a structure. I don't think it is possible to do what I want, but I wondered what others thought.
View 5 Replies
Nov 26, 2011
Well... I'd like to ask you a question that makes me crazy...Could I create an array of structure and later delete a value from that?For Example I have a structure called "Examples". I create an array of structure and insert 3 values (whatever). Then, I want to delete the value in the position 2 (which real position is 1 [0, 1, 2]). Could I do that?
View 2 Replies
Aug 20, 2011
I am wanting to create a logon similar to the Windows Live logon, so in other words. user has frmLogon and is located in Australia. The user enters his/her details and then the program connects to a server in the United States and checks the Username and Password to make sure it is correct if it is correct it allows the user to logon and move to the next stage, if it is wrong it will give him an error message. I am wondering if anyone has a tutorial or source code laying around that I can rip apart and see how it works. I want to put the database on my server and connect to it from my desktop using the logon form.
View 3 Replies
Jan 1, 2012
I'm looking for a way to create the treeview structure in memory with a classes, so I can loop through them, like with a collection and easily load the data into a treeview, listview, datagridview or simply work with the data in the background.
There's a treenode class that I could use, but I've noticed that when I have a lot of data in the nodes, it has a lot overhead when for example serializing, because it also saves the checked state, imageindex of the nodes and things like that, which I never need. The saved file is about 10 times bigger than the actual data, which is not acceptable.
View 4 Replies
Sep 2, 2011
I have the following Structure within a class[code]...
How do I efficiently use this list?[code]...
View 1 Replies
Aug 16, 2010
I've got an application that takes the files in a folder structure and publishes them to another location. Currently it goes through every folder/file and compares the dates in the source and destination. If the file doesn't exist in the destination, or is older, then it copies it across from the source. It's obviously foil proof, but not as fast as it could be.
Ideally, I'd like to create an audit (or audits) saying what the current state of play is in the destination and compare the source folders/files against that instead.
This of course assumes the destination isn't messed around with manually, but I think that's a fair limitation.
So has anyone got any suggestions for how this audit could work? ie: How I could store data/values, such that on the next run when I look down the source folder/files I could compare it to the audit and see 99% of the files are unchanged, so only send across the X new ones etc?
ps: I don't suppose there's a valid (in Windows) that can tell you the date any file in a folder was created/amended? ie: So rather than checking down 200 files to see their individual dates/times, if I could get a single folder level value saying the date of last update/create, if it hasn't changed since the last run, there's no work to do! There is GetLastWriteTime but this doesn't seem to get updated if you amend/update a file, rather than creating a new one!
View 6 Replies
Oct 28, 2011
am trying to pupulate a treeview nodes base on directory structure like this
[Code]...
The above code works for add base/parent node say i have a urllike this [URL] in this case, it should create a child node dir2 in parent node dir1 am getting confused add child nodes to the existing nodes
View 2 Replies
Dec 12, 2011
Can i create a structure file in vb.net in windows form ?
View 2 Replies
Feb 20, 2010
I want to create a user defined data structure, which will be a 2 dimensional array such that each individual square of this 2-dimensional array will also store the score and the grades. ( Iam using VB.NET)
More details: for example: There is an 2 dimensional array with 3 columns and 2 rows, I want to fill each of the
[Code]...
View 2 Replies
May 10, 2010
I am creating an Add-In that I want to create classes and forms based on a database structure. I can't find any information anywhere on how to programatically add code to classes. I know I can write out the files and add them to a project, but that would limit what I can do in the future. I would like the possibility to update a function in the future which would be impossible writing out a file and loading the whole thing back in. It would destroy any modifications made to the class, and since this Add-In will only be creating a framework, there will usually be modifications.
I got this line from the macro recorder:DTE.ActiveDocument.Selection.text = strDACode
But I like to keep Option Strict on, and this is late bound according to the IDE. There seems to be very little help on the IDE and how to use it creating Add-Ins. If I overlooked something please point me there, but I can find nothing. I don't know if it can be done, but I was able to do it in an Add-In for VB6.I would also like to add controls to a form, so if anyone can point me somewhere where it explains
View 3 Replies
Mar 8, 2012
How can I create a list (of my custom structure) to hold only unique items? This list should be created from another list.[code]...
View 5 Replies
May 20, 2010
I know how to check whether an item exists in a list using (MyList.Contains), But I do not know how to check the whole list. For example (use one button and one richtextbox):
[Code]...
View 14 Replies
Jan 5, 2012
Module Module1
Public Structure structure1
Public TRANS() As structure2
End Structure
Public Structure structure2
Public X() As Integer
End Structure
End Module
View 17 Replies
Jan 5, 2010
I'm new to VB 2008 after having spent a long time with VB6, so I apologize if this is a stupid question. But I'd really like to have this straightened out.
Let's say I have a pretty large structure that has lots of properties.
Code:
Now say that I want an internal database with about 10 instances of this structure total, describing, say, 10 different products that a store sells. When these values are loaded from a database, they remain totally static. (However, they can be different each time a program loads)
Now say that I have a class. Each instance of this class is a type of that BaseProduct structure. Meaning, each instance of the class pertains to one of the 10 types of products that the store sells. However, this class has additional properties that pertain specifically to each instance, which are not static.
Code:
Now, the problem here is... If I have 200 different transactions, each one contains an instance of BaseProduct. BaseProduct is HUGE, and is largely redundant (only 10 types possible), so I think it's a little silly to include a whole copy of it with EVERY transaction. However, the Transaction class really needs information regarding the base product it pertains to. Is there a way to, instead of declaring a New BaseProduct in the Transaction class, to simply make one of the properties of the Transaction class a pointer to a BaseProduct variable?
In VB6, I would accomplish this by making a BaseProduct(10) array, and then giving each Transaction an ID number referring to an entry in that array. But in VB 2008, using class structure, this is impossible. I can't define the BaseProduct(10) array outside of a class in a namespace, and if I define it in the actual application's form, then the class loses modularity since it relies on the application that's using it.
View 11 Replies
Aug 29, 2009
I am trying to communicate with an external device and i am trying to send a byte array to the external device via sockets but i am always getting a response the message size is too small so i am not sure what i have done wrong. Between the data type there should be no alignment present and all numbers are represented in little endian format. The char array is not null terminated as mentioned in the protocol specifications.
I have to send data based on a struct that embeds 2 other struct. So here's my vb.net code for the struct used to convert to byte array and the sending part.
Public Structure MESSAGETYPE_OIP_Login
Dim Header() As COMMANDHEADER
Dim UserName() As PSTRING
[Code]....
View 2 Replies
Apr 14, 2012
I'm experiencing a problem with the following c-structure:
typedef struct tagTEXTUREPROP
{
DWORD dwSize;
[Code].....
The Marshal.SizeOf obviously calculates a size of 76 and it works with the DLL function, but it leaves me with some bad feelings.
View 1 Replies
Apr 25, 2010
I'm having a problem that's driving me crazy; I can't understand how to convert the XML structure into a class structure (that I want to use to hydrate a XML document).
The XML document looks like this:
xml
<?xml version="1.0" encoding="utf-8"?>
<artists xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.spotify.com/ns/music/1">
[code]....
View 2 Replies