Enumeration Already Finished?
Dec 17, 2009Is there a way to check to see if the enumeration is already finished?
View 3 RepliesIs there a way to check to see if the enumeration is already finished?
View 3 RepliesI have just received an interesting feedback from a VB.NET customer using our product - for some reason intellisense hidden a certain enumeration value.After a small testing I have found that this is likely a bug in IntelliSense: [URL]..To be honest, I did not expect this problem with such a basic stuff like this. Have you seen this in the past? For me, it doesn't work in all VS versions...
Anyway, feel free to track this issue if you are coding in VB.NET.
I am using the following command to install a driver withing my program: Process.Start(Application.StartupPath & "USBG-232MM_Driver.exe")
This installs a driver for USB cable(not important).
1- I would like to wait untill the driver finishes installing before I go to next step. Is there anyway to know if this process is completed?
2- After I plug the USB cable the computer starts the detection. I like to know when the device is detected and ready.
I have the following enumeration:
Code: Enum E1{ LOW = 'L', MEDIUM = 'M', HIGH = 'H' }
I have loaded those values to a combo box, but how do i display the value of "MEDIUM" (I.E. M), when i select "MEDIUM" from the combo box.
Can I use enumeration in a loop? something like this:
Enum Days As Integer
Monday = 1
Tuesday = 2
Wednesday = 3
End Enum
[Code]...
I have a Windows Forms UI, a Class Library, and a WebService. I need to be able to pass an Enumerated type through each of these layers (SystemType). For instance, the UI passes the type to the class library, which then passes the type to the Web Service.My question is, where do I define this enumeration type so they all know about it.
Options so far:
- Each project contains the exact same enumeration.
- Put the enumeration in its own project and reference this assembly from each of the other projects.
I have an application that allows the user to upload information from and Excel sheet. Since the user is more familiar with Excel, they prefer to do it this way. My software will close the workbook with Me.exApp.Workbooks.Close() , but if you have the task manager running, you can see the Excel application continues. I know the workbook is closed, b/c it asks if you would like to save changes. One instance of Excel will close when the program is exited, but the user normally builds a folder of Excel files and does them all at once. If 8 instances of Excel exist, only one will close with the program.
View 2 RepliesI've made a tabbed web browser and I'm using
CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Stop()
instead of WebBrowser1.Stop() for navigating.
but I want to know when a web page has finished loading?
Normally the following works, but not with tabs
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
End Sub
I am having no trouble playing a swf file in VB but how can a play a second SWF file AFTER the first has finished? How do I know when the first file is done playing? Tried 'isplaying' method in a while loop but can't get it to work.
View 5 RepliesI have a piece of my code that uses a for each to loop a certain amount of times depending on how many saved fields there are in an xml.
vb.net
'// Write an .html file ready for debugging
If (File.Exists("Working/" & textBoxCampaignName.Text & ".html")) Then
'// Do nothing the file exists
[Code]....
So the for each loops depending on how many nodes it finds in the ("/campaign/secondarySection") this works great, it loops accordingly, what i'm trying to figure out is a way for a messagebox to show once the loops are finished, i can't think of a way to find out once the loops are done.
I'd like to know... well, I have finished a project managing databases and all that stuff... and using ADO.NET, some databases and the main program, I'd like to compile it all to make an installation and use those databases.If I use the exex that is inside the debug folder... in other computers gives error and don't show the content of the databases. What I want is just the exe but with the databases visible in the other cpus, how to install the app in any windows computer and what I need to know or give is:
If I have my installator and I give this to a friend, he can use the databases ? He need the SQL 2005 Management to see that content of the databases ? Or I can just give him the program and work with the databases??
I have some code that needs to be executed right after the page has been loaded inwebbrowser controli tried numerous things like if webbrowser.isbusy = false...but that will check it only one time, and when it's executedwebbrowser control doesnt wait for page toload to continue executing program, so it's no use to put my code after webbrowser.navigate
View 4 Replieshow to cause it so that my program will not proceed while a web page is loading. For example, if I use this:
webbrowser1.navigate(www.amazon.com")
sometimes it will have finished loading the webpage before the program proceeds. Other times, even if it says it is done, it is not done and it causes my program to crash.
how I can cause my program to stop and wait until it is sure the webbrowser has completed loading?
I am trying to figure out if the DayOfWeek Enumeration list can be sorted by using the integer value (ie Sunday = 0). Ultimately I want to take the DayOfWeek Enumeration list and population a dropdownlist with the days of the week from Sunday - Monday and I do not want to hard code the items in the HTML markup. Is this possible?
View 1 RepliesI have some code that i cant work out why its happening and how to fix it. What im attempting to do is loop through the controls in a gridview and replace it with another control along with the text
Dim i As Integer
Dim row As GridViewRow
Dim rowCell As TableCellCollection = row.Cells
[Code].....
I have a case where my enumeration is like this:
Public Const PREVIEWCREATE As Integer = -3
Public Const SETUP As Integer = -2
Public Const PREVIEW As Integer = -1
I then have a form post where i recover a string like:
Dim mode_custom_mode = request.Form("custom_mode")
I can do
Select Case UCase(mode_custom_mode)
Case "PREVIEWCREATE"
[Code].....
is there a more direct way in VB to do something like:
t.StartupModeId = StartupMode.(mode_custom_mode) ?????
Is it guaranteed that the numeric values for an Enum with only uninitialized values start at zero and increment by one in the order defined?
View 2 RepliesI've been getting the following error from time to time and have been unable to determine the cause of it:"The given key was not present in the dictionary."The line that this is occurring on is:If CType(ViewState("FieldType"), MYClass.FieldType) = MYClass.FieldType.ShowOnDirectory ThenI have no idea as to why it is throwing this exception on this line. I thought that perhaps an invalid value was being placed in the ViewState so I tried while debugging setting the value to Nothing and setting it to a value that wasn't in the enumeration and it still works. I was originally storing the enumeration in ViewState and then went to storing just the Integer equivalent in there
View 4 RepliesI would like to use a keyword (reserved word) as a constant name in an enumeration.The reason I care about the name is I set a ListBox.DataSource to the .GetValues of the Enum Type.This way the list of constant names show up in the list box and the ListBox.SelectedValue can be tested to determine which constant value has been selected.What I would like to be able to do is as follows:
Enum
Style
As
Byte
[code]....
This was an attempt to override the Name property from S to Single However I get a pre-compile error stating: "Too many arguments to 'Public Sub New()'."
Enum age
Over18
Under18
End enum
[code]....
'age' is a type and cannot be used as an expression.Is there any way of using enums in "select case"?
I have a form event that calls a public function in a class. I am trying to use an enumeration that is in the class from my form, but I'm getting a green squiggly line under clRS.enmProcedure.SetReady.
The error says this:
"Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated."
Private Sub dgvResults_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvResults.CellContentClick
If clRS.pubfnc_UpdateResults_M(dtResultID, Me.dgvResults, clRS.enmProcedure.SetReady) = "Failed" Then
Exit Sub
End If
End Sub
when does the computer calculates Enum?in other words wiill this 2 be Exactly the same?
dim a = 1
dim a = myenum.value_equates_to_1
i've got a feeling its faster when we do not use enum, just wanted to make sure
I have recently developed and finished a software in which works like aim.But here's the problem, the server worked just fine for local friends because they lived only 25 miles from the server, so it was lag-less.But when uploaded to a web host, it lags every time it pings the server.The server is in PHP, so there's no need to buy a dedicated computer for 400$/month more.Here's the function in which the client constantly calls upon:
[Code]...
I was thinking about recoding the getpage function so that it would connect to a TCP server and constantly wait for new messages which I am still not sure if this might cause a lag if the host is in the US and the client is not(for example). provide me a remedy to this problem?
How do I tell if a Video is finished playing?
View 3 RepliesI built a program in visual studio 2005 that access a Microsoft Access database. I need this program to be a standalone program on many machines. To do this, I need to install a copy of the database when the program installs. I tried including it in the application files part of the build, but the problem I am having is the connection strings dont update with the install. It still tries to point to the folder it is in on the comnputer i built the program.
View 11 RepliesHow to make a button to show up once/while typing something on textbox is finished.
Say that you are typing something on a textboxes and once you finished them, a button will suddenly shows up.
If anyone knows how to do this stuff, please post some sample codes and explain it for me in a brilliant way.
I am making a program and I would like it so when the progress bar finishes it open form2. Here is my code:
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(1)
If ProgressBar1.Value = ProgressBar1.Maximum Then
End If
Would I make it, like progressbar1 makes it to maximum form2.show()
When a button is clicked,my program gets the list of all Drives on a current computer.Then I use String.Concat to merge the drive letter and the rest of the path.So I get something like: "C:" + "somefoldersomefile.some_extension"That creates a full path to a file I am looking for.Then I check if that file exists.If it doesn't exist,I use Process.Start to run the setup file(to install the program I need).It works well and installs the program I need.I want my application,after the installation is finished,to check again if the program is installed and ofcourse confirm that it is.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim DriveList As String() = Directory.GetLogicalDrives()
Dim Drive, FullPath, Path1 As String
Dim EmptyDrives As Integer
[code]....
I would like to know if what I have here is correct? could it be done better? is there something I could add or take away? or is it finished and does what it does? I'm also posting it so that other beginners can maybe look at it and learn from it, just copy and paste the code in to a new Windows Forms Application, hit F5 and then Space bar.[code]
View 16 RepliesI'm new to VB and trying to convert numbers to a string then add the string together but VB keeps putting a space at the beginning of each number after i convert it to a string.
[Code]....