|
The word Greeting in gives me an error; " name is not declared" how can i solve it?
Private Sub DeliveryOptions_EnterEvent(ByVal sender As System.Object, ByVal e As AxVBVoiceLib._DGetdgEvents_EnterEvent) Handles DeliveryOptions.EnterEvent
'ByVal Greeting As Object
Greeting.RemoveAll()
Greeting.InsertIndexPhrase(0, FILE_LEAVE_VM_VAP, LV_VM_TO_SEND_MSG)
|
|
|
|
|
This means you don't have a variable called "Greeting" defined anywhere in scope.
Seriously, pick up a beginners book on VB.NET. This is a very basic error caused by not knowing how to declare variables.
|
|
|
|
|
Dave is right, you really need to get up to speed on your VB
First, you have you declaration of Greeting commented out. I guess that you did that because when you didn't the .RemoveAll() and InsertIndexPhrase() methods errored out. This is probably because those methods are not standard members of the Object type but rather members of some VBVoice object type.
|
|
|
|
|
Hello all!
When I call one of my dialogues with the ShowDialog() function my application exits. Just like that. No error message or anything. I have tried catching the error but it does not help. Also, this problem occurs only on some machines, all of which have no debugger installed. Unfortunately I have no idea where to start looking for the error. Does anybody know anything I can do short of writing the thing from scratch?
Happy new year!
Volker Weichert
|
|
|
|
|
If there's no error message, odds are, there's no error. One thing springs to mind - if you have a dialog with a button defined as being the OK button, and it launches a child with an OK button defned, pushing OK will close both.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you for your answer.
In this case the parent form is a normal form. Also, I traced through the program and pinpointed the error to the actual ShowDialog() method. Since the dialog does not show but the application quits I guess there is an error somewhere. I just have no idea where to look for it .
Volker Weichert
|
|
|
|
|
I'm trying to write a method that loops through a form and dumps the name of all controls and the data from each control into a string, it works fine until it gets to a control that its self has controls in it, like a tabcontrol. Is there any work around so I can get this to work in a single method? The getValue(childControl) function simply uses a typeof check and returns the data of that control as a string. Any help would be appreciated.
Public Function reportApplicationState(ByVal controlList As Windows.Forms.Form.ControlCollection) As String<br />
Dim strIndent As String = ""<br />
Dim report As String = ""<br />
Dim childControl As Control<br />
For Each childControl In controlList<br />
If childControl.Controls.Count > 0 Then<br />
layoutIndent &= " "<br />
report &= childControl.Name & ControlChars.CrLf<br />
Dim nextChildControl As Control<br />
For Each nextChildControl In childControl.Controls<br />
reportApplicationState(nextChildControl.Controls)<br />
Next<br />
Else<br />
report &= layoutIndent & childControl.Name & getValue(childControl) & controlChars.CrLf<br />
End If<br />
Next<br />
Return report<br />
End Function
|
|
|
|
|
Additional info: reportApplicationState(nextChildControl.Controls) - throws exception
Exception thrown at runtime:
System.InvalidCastException was unhandled
Message="Unable to cast object of type 'ControlCollection' to type 'ControlCollection'."
Source="detailedErrorReports"
StackTrace:
at detailedErrorReports.StateReport.reportApplicationState(ControlCollection controlList) in C:\Documents and Settings\Ed\My Documents\Visual Studio 2005\Projects\detailedErrorReports\detailedErrorReports\StateReport.vb:line 12
at detailedErrorReports.Form1.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\Ed\My Documents\Visual Studio 2005\Projects\detailedErrorReports\detailedErrorReports\Form1.vb:line 5
sorry about the code sample indentation
|
|
|
|
|
I'd probably rewrite this so you don't have a "nextChildControl" section. One level should be enough.
Speaking of level, I'd also change this method to take as parameters a ControlCollection AND an interger representing depth, so you can have a collection in a collection in a collection, ... Probably something like this:
Public Function reportApplicationState(ByVal controlCollection As ControlCollection, Optional ByVal childDepth As Integer = 0) As String
Dim layoutIndent As New String(" "c, childDepth)
Dim report As String = String.Empty
Dim childControl As Control
For Each childControl In controlCollection
If childControl.Controls.Count > 0 Then
report &= childControl.Name & ":" & Environment.NewLine
report &= reportApplicationState(childControl.Controls, childDepth + 1)
Else
report &= layoutIndent & childControl.Name & getValue(childControl) & Environment.NewLine
End If
Next
Return report
End Function
This is by no means tested, but you should get the idea...
|
|
|
|
|
Your right in saying only one level is needed, the inner loop was only added after i initially had problems. This works fine for all controls on the controlList passed in, but when it calls its self when it finds a control with child controls i get an error casting from the child controls to a control list even though they appear to be of the same type. Any ideas on why the cast fails would be appreciated.
|
|
|
|
|
Hi Developers
I'm looking for an Open Source Invoice Management System, which I can modify easily according to my needs....
Please let me know if you know about any good resource about it. Thanks
|
|
|
|
|
|
Respected Dave
I googled first and then I posted here for help, anyways thanks for your HELP
|
|
|
|
|
Hi,
I'm building an app that will heavily use XML for inserting,searching,replacing,deleting...
I have solved most of the mechanics, but I didn't see a huge bug in my idea.
I need to insert xmlNodes or xml Elements in specified places in the file. Currently i'm using :
xmlNode = xmldocument.createElement("Element1")
xmlNode.setAttributes("Att1",Val1)
xmlDocument.documentElement.firstChild.FirstChild.appendChild(xmlNode)
etc...
The huge flaw of this is of course, as the file changes so the positions of many elements change so firstchild.firstchild becomes a totally different element over time as I do work on the file. So it is somewhere else like : childNodes(12).appendChild...
My question is: Is there a way to insert files using XPath or something like that where I could specifiy the name of the element or the relative path to it. like
xmlDocument.appendChild("//Category/System/[@ID=5]/SubRoutines/[@level=3]
something like that, well you get the idea.
Thanks a lot!
|
|
|
|
|
So you're looking to control the order of the children that show up under a node in the tree?? You can't control that. XML doesn't make any distictions about the order of child nodes common to one parent. Only that parent nodes must come before children.
You'd have to load all the current children into a collection, remove them from the XML document, then add them back to the parent node in the order you want them to appear.
|
|
|
|
|
I'm not sure if this is exactly what you are looking for, but I use an object of type System.Xml.XmlNodeList to reference xml nodes (I use VS2005, not sure if it's in other versions). The GetElementsByTagName will return a NodeList with all of the nodes that match the name. For example, this bit of code will set the variable strValue to the value of the first element in the file named "Element1":
Dim xDoc As New System.Xml.XmlDocument<br />
xDoc.Load("C:\MyFile.xml")<br />
<br />
Dim strValue as String = String.Empty<br />
<br />
Dim xList As System.Xml.XmlNodeList<br />
xList = xDoc.GetElementsByTagName("Element1")<br />
<br />
If xList.Count > 0 Then<br />
strValue = xList.Item(0).InnerText<br />
End If
Hope this at least helps point you in the right direction.
|
|
|
|
|
You could try to add a key attribute to the nodes that have to be sorted. Then write a class that implements IList and keeps its elements sorted after adding. That way you cannot sort the nodes in the xml file but have them sorted in your program. On the other hand, if you add another function that returns a sorted XmlNodeList you can insert the result of that in your XmlDocument and have a sorted list of childnodes in your file.
|
|
|
|
|
Hi Folks
I have this basic code.
Dim db As New MyLinqDataContext
Dim o As New Order
o.OrderName = "Cool Order"
db.Orders.InsertOnSubmit(o)
db.SubmitChanges()
db.Connection.Close()
(I originally have tried this on C#)
I have an orderid column which serves as a primary key which should update automatically when i insert the record.
When the code runs there is no record but the database is not updated. Anyone else having issues with this. Im using the express versions of visual studio 2008. thx in advance.
|
|
|
|
|
I am not very sure about this....
Is ur Database have auto commit option??? If not commit the transaction first
Good Luck
|
|
|
|
|
Hi all,
I want to save a webpage that contains tables into an excel file
using VB or VB.Net
thanks in advance
Priya
|
|
|
|
|
What's the question?? What part of this are you having problems with??
You can't save the table directly to Excel. You have to parse it out of the HTML data and put it into the cells you want, one cell at a time.
|
|
|
|
|
Hello every one
I have a Vb 2005 Express application.
I am using a label over a picture box (it has a scroll bar).
I want to have the background color of the label as transparent so that whenever the picture box is scrolled in the background of the label, every thing can be seen
But when I do this the back color of the label is of the color it first gets..
What should be done??
|
|
|
|
|
A Transparent background is NOT transparent. You cannot see the other controls on a form through a transparent background. Transparent means that the label control will use the background color or image properties of the parent form. If the background of the parent form is yellow, you're label's background will be yellow.
You'll have to create your own version of the label control, providing the painting code to create the effect you want. You can find an example of such here[^], or here[^], or the entire list of Yahoo search results for ".net transparent label control[^]".
|
|
|
|
|
hi guys
i have installed framework 2 on my system but there was framework 1 already installed,
now i am facing a problem that in control panel, admin tools, framework2 configuration icon is not seen , it is only previously installed framework 1 configuration, why is that ?
thanks in advance
hello
|
|
|
|
|
That's because, starting with .NET 2.0, the security tools have been moved to the .NET Framework SDK. They don't ship with the redistributable version.
Read here...[^]
|
|
|
|