For my application, I want to have one form ("Action Form") that (1) remains visible, (2) reports progress in a scrolling text box and (3) receives user input via clicks to its command buttons and menus.While the program runs, I need to show some results in different forms in two other windows (let's call them "Graphic Form" and "Accounting Form"), updating these as we run. You might call these Read-Only windows.
That's it. Can't be all that difficult, right? I did it in VB6 with no problems.However, in my .NET attempts, once I update information on either of the other forms, my Action Form loses focus and I can't get it back. It's there and it keeps updating, but its menus and buttons don't respond any more.
Is it possible to manage three (or more) Forms in this fashion. Maybe the other windows should be Frames or something instead of Forms, but I can't see how to do that.(It may be because I'm using "Sleep" to slow the updates to readability on the other forms. Maybe I should be using a timer.)
EDIT:It seems to work so long as I take care to update the Action Form last of all, after the others, so maybe this is a "Never Mind."However, if anyone has any ideas on how best to implement Read Only Windows for auxiliary displays, I'd like to hear them
always had a problem getting my head around it. I don't have a very strong mental model of how the code flows. My main problem is i think i understand the syntax, but not really its application. Any links people found useful would be great.
Couple of questions. The code below doesn't make sense to me (written by someone else) the application is basically a csv reader, but manipulates the data. Public Sub entryType()
I'm trying to convert data from a vb6 application. Using get and put I saved a structure to a file in vb6. I'm now trying to read it into a vb.net class using BinaryReader.[code]...
I'm trying to develop a program structure in very broad terms. At this point, the Forms used do nothing but call other Forms and allow for their closure. After startup and initialization activities, I want the user to set up options and run the program. The program can be run again (click one button) and again with the same options, or (click another), the options can be changed for the next and subsequent runs. Clicking a third button will cause shutdown activities to be performed.
Sounds pretty simple. However, I get the options form the first time, but subsequent ShowDialog calls cause the form to pop up (I detected a Load and an Activated call) for an instant, then disappear, and the program rolls on without permitting option selection, even though the key variable NewSetup is definitely True.
Code: Public Class RunMain <STAThread()> _ Shared Sub Main()
I'm trying to implement for the first time a library. With the event sub "client_TickPrice" I want to update a textbox. However nothing happens to my form when the "UpdateLast" sub is called from there.? The code was originally inside a Module (not a class like now), and set up as a console application. Probably there is a problem with the way I wrap my code, i.e. use of classes etc. This program is supposed to receive realtime stock/futures price data. Is it still a good way to start this code with the form, or should I make some type of console application?
Public Class Form1 Dim prog As New Program Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load prog.Main() [Code] .....
I'm trying to write a short program to for work but I'm not quite sure how to structure the code. This is what I currently have;[v I'm pity sure this is majority the wrong way to structure it as at crashes with the IF/ELSE field going up to around 50000, but it does work (if a little sluggishly) when set to 5000.[code].....
I am writing a program that utilizes a three-tier structure with presentation, business and persistence classes. I am needing to use a ComboBox to select a specific account type which will call a class. How do I get the program to call a class after the user has selected an account type from the ComboBox?
Module Module1 Public Structure structure1 Public TRANS() As structure2 End Structure Public Structure structure2 Public X() As Integer End Structure End Module
So I'm trying to program a selection structure to display different commission rates per sales entered in a textbox.I need to have the commission total display alone. I have the simple interface done, but I'm having trouble forming the selection structure.
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.
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
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">
I am using Visual Studio 2008 Setup project. I need to copy one folder and the sub folders into the program files but when I tried to copy or add the folder to "Application Folder" in File System editor, I am able to add only files and not folders.
Public Structure LogicalEdge Dim sTypeEdge As String Dim dTotalLengthOfLines As Double Dim lstLinesInEdge As List(Of Line) End Structure
In my code, I create a new list of this LogicalEdge:
Dim myListOfEdges As List(Of LogicalEdge) = New List(Of LogicalEdge)
After, I create a new LogicalEdgecontainer:
LogicalEdge = New LogicalEdge
I set one of it's properties:
LogicalEdge.sTypeEdge = "endcap"
Now, I add it to the list
myListOfEdges.Add(LogicalEdge)
After looping a few times, i want to set one of the other propterties for the same item in my LogicalEdge, but when i do this:
LogicalEdge.dTotalLengthOfLines = 80.77
To look at the values in the collection, I loop through myListOfEdges collection; and I see that dTotalLengthOfLines doesn't pick up the value i have assigned to it. i thought I might need to identify which item in myListOfEdges to add it to... so i tried this:
I'm sure there is an answer to this somewhere but I'm clearly using the wrong terminology in my searches, so I apologise in advance for this inevitably being a duplicate.Take the function CType. Clearly I can cast (or at least try) a given object to a given reference type. The function will not work if trying to cast to a structure, i.e.CType(myObject, Integer)
will generate a compiler error. This I'm sure most often crops up when working with generics:
[Code]...
What is the opposite? I want only reference types so that CType doesn't fail. I can't overload the T As Structure with a plain T because it considers them identical signatures, so surely there's a keyword I'm missing somewhere?
Recently I found that I'm not able to instantiate a structure for an array:
Dim mObjectLists() As New objectLayout
Ok, fair but It's an easy way to store a bunch of data in an array instead define a class. And after that I tried to define this:
Dim mObjectLists() As Collection
And add structures to the collection. But it says you should instantiate the reference object first. I searched about creating own Collection based on the base collection class but I think It's wasting time to write a code with class inheritance instead the first sample.
In a recent project I was working I created a structure in my class to solve a problem I was having, as a colleague was looking over my shoulder he looked derisively at the structure and said "move it into a class". I didn't have any argument for not moving it into a class other than I only need it in this class but this kind of falls down because couldn't I make it a nested class?
I need to convert structure from VB6 to VB.Net. This struct is used to pass to a c++ dll. The problem is that the following struct size in VB is 113, but for some reason in VB.Net is 116.
I have an unmanaged C++ dll that I am using in my program. I have successfully used several functions using DllImport. I have run into a problem with one function that takes a structure as input. I originally tried building a structure to pass to the function, but this was unsucessful. So i created a class to define the needed structure. When I pass this, I get no error message, but also no data is passed back to this variable. I have a C++ example of how to use this function, but I don't know how this translates to VB 2005. Here is how they call it in C++ .
Code: Public Structure StrFolder Public isActive As Boolean Public NameFolder As String[code]....
I would like to retrieve and print each variable name within a given structure (not its value). For example:
StrFolder(0).Name should print "isActive" StrFolder(1).Name should print "NameFolder" StrFolder(2).Name should print "URLIDNumber" StrFolder(3).Name should print "DateOfFolder" etc..
I would also like to know each type of an item within a structure. For example:
StrFolder(0).Type should print "Boolean" StrFolder(1).Type should print "String" StrFolder(2).Type should print "Integer" StrFolder(3).Type should print "String" etc..
What is the best way to get a structure from memory, I know the format:
[Code]...
The structure is 53 bytes until the chat text, the message length is determined by one of the structure variables LineLength, so what is the best way to get that and put into into a structure?
I have a structure with types ranging from thread's to control.what im looking for is a easy way to iterate through those item like For eachbut i couldn't get for each to workis there a way to do it
I'm sure I need to do a for each <something> in my something..but I cant figure out what..I kinda want to make a trace program for my structure so I can loop through and split out the name and the value in it..