|
I'm working on a project Visual Studio and in my
project, I am not able to use .NET dialog boxes (ie. MessageBox.Show,
OpenFileDialog, etc.). I have to use the dialog box code from VB6.
Why is this happening and how can I fix it?
|
|
|
|
|
Joe - D wrote:
MessageBox.Show
MsgBox("My Message")
Joe - D wrote:
OpenFileDialog
Dim openDialog As New OpenFileDialog<br />
openDialog.ShowDialog()
Hope this helps
Tom
|
|
|
|
|
Joe-D
Messagebox and openfiledialog are in the System.Windows.Forms namespace. Make sure it is referenced/imported etc... properly.
The openfiledialog is a control from the toolbox that you could drag onto your form or
Sample from Help
Dim myStream As Stream<br />
Dim openFileDialog1 As New OpenFileDialog()<br />
<br />
openFileDialog1.InitialDirectory = "c:\"<br />
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"<br />
openFileDialog1.FilterIndex = 2<br />
openFileDialog1.RestoreDirectory = True<br />
<br />
If openFileDialog1.ShowDialog() = DialogResult.OK Then<br />
myStream = openFileDialog1.OpenFile()<br />
If Not (myStream Is Nothing) Then<br />
' Insert code to read the stream here.<br />
myStream.Close()<br />
End If<br />
End If<br />
|
|
|
|
|
I checked what was imported in the project properties and it is show Microsoft.VisualBasic. When I removed this, all of the places where I have had to insert MsgBox became an error. Perfect, but then when I try to replace MsgBox, MessageBox is not recognized. What do I have to Import into the project properties?
|
|
|
|
|
Forget about msgbox. Use MessageBox
In the project references make sure that System.windows.forms is referenced else add it.
|
|
|
|
|
Hi,
My form have a datagrid from ArrayList.
I would like to modify some cells of values using "edit-in-place".
After I press keyup, the new cell value is canceled and show that message: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: Index Do you want to correct the value ?"
How can I modify a cell value using "edit-in-place" on Datagrid ?
Thanks.
|
|
|
|
|
Hi,
My form have a datagrid from ArrayList.
I would like to modify some cells of values using "edit-in-place".
After I press keyup, the new cell value is canceled and show that message: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: Index Do you want to correct the value ?"
How can I modify a cell value using "edit-in-place" on Datagrid ?
Thanks.
|
|
|
|
|
Try reading this, you may get some hints
http://www.developer.com/net/vb/article.php/2228761
|
|
|
|
|
Hi! I have a main form that handles several other child forms.The thing is that when i close the main form, and i want to close all of the child forms, it seems that the Main thread doesn't wait for the child forms to terminate.The main form calls Dispose() which destroys the mainUI first than the childs. Is this the correct procedure or do i have to destroy first the child forms and only then the mainUI?
Thanks in advance.
Never say never
|
|
|
|
|
Hi,
- If the Form1 is a MainForm then (Form1 -> Property -> isMdiContainer=True)
- I hope the below code will help U
Private Sub CallForm2(...) Handles MenuItem2.Click
Dim F2 As New Form2()
F2.MdiParent = Me
F2.Show()
End Sub
Private Sub CallForm3(...) Handles MenuItem3.Click
Dim F3 As New Form3()
F3.MdiParent = Me
F3.Show()
End Sub
Private Sub CallExit(...) Handles MenuItem4.Click
Application.ExitThread()
End Sub
With Regards
PANDIAN S
|
|
|
|
|
what functions should i use for a runtime chating program over the network and not over the internet having a security blocking the edit of a file or a database on the server (bypassing writing on a file or a database, i already try that)
10x
|
|
|
|
|
Hi,
I have a Map system (mentioned in the object) that in VB6 is addressed that way:
private mpview as IMapView (an interface)
mpview=axmap.object (where axmap is the control on the form)
The problem with VB.NET is that I don't have the .object property. And if I simply try mpview=axmap I get an invalid cast....
Any idea how to work it around?
Thanks
Briga
|
|
|
|
|
A better bet would be to ask the manufacturer of the control what the correct procedure is for VB.NET. You'll find a very small user base, if any at all, for people with experience with this control.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If the manufacturer of the VB6 OCX cannot provide you with the NET Interop assemblies needed to use the VB6 OCX in .NET, then what you will have to do is put the Map control in a VB6 UserControl that provides all wrapper functions you need to interact with the child Map control from your NET application. Then you should be able to import the UserControl you created into VB.NET.
You should review your licensing agreement. Most commercial VB6 OCX controls prohibit reverse engineering, and wrapping in another OCX for purposes of redistribution to other developers. Wrapping a 3rd party OCX in your own custom control OCX for use in your own applications is rarely a violation. But you should still check.
Robert
|
|
|
|
|
Thank you Robert for the reply. I did it and it did work, that has been a very good idea. Now I'm struggling with a couple of bitmap pointers but all the rest works properly. Sorry for the late reply but I was away for a while!
Briga
|
|
|
|
|
I have a small problem I want to get the primary key to insert into a another table but the problem is that the only thing is I have an autonumber that gets created and that is the PK and the only other thing that goes into the datebase is the date. any sugestions on how to get the newest autonumber created.... Thanks
I am the one the only king cobra
|
|
|
|
|
kingcobra0128 wrote:
sugestions on how to get the newest autonumber created
SELECT Max(Id) FROM MyTable;
Hope this helps
Tom
|
|
|
|
|
Hey Tom Thanks I figured it out after a while I just had to think which I wasnt doing very well last night around 3:00 am
I am the one and only king cobra
|
|
|
|
|
when ajusting the column width of MSFlexGrid Control with mouse ,how to capture the event?
thanks
|
|
|
|
|
There is no event for that fired by the MSFlexGrid control. The only your going to see is a Click event firing for the entire control, not the column that was resized.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How to code by VB.NET
I am junior Programmer, want to up grad my skill
|
|
|
|
|
jang_dotnet wrote:
How to Open file Media and Record Wav by Wav
???????????? What ????????????
We'll need a much better explanation of what you want to do. What do you mean by "record wav by wav"?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
OKay here is the thing. I want to use MD5 to hash a user-defined value into an xml file. The problem is the hash isn't getting to the file. I know the value is being hashed because I put in a message box at the end of the code to display the value of the text box and it comes up as hashed. When I check the xml its not hashed just in plan text. here is the what I am useing. NOTE: No its not the whole thing just all that should be needed to figure this problem out. If you notice I try to hash the username one way and the password another because those are the only two ways I could think of.
Code:
Option Strict On
Imports System.Threading
Imports System.Text
Imports System.Security.Cryptography
Private Function GenerateHash(ByVal SourceText As String) As String
'Create an encoding object to ensure the encoding standard for the source text
Dim Ue As New UnicodeEncoding
'Retrieve a byte array based on the source text
Dim ByteSourceText() As Byte = Ue.GetBytes(SourceText)
'Instantiate an MD5 Provider object
Dim Md5 As New MD5CryptoServiceProvider
'Compute the hash value from the source
Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText)
'And convert it to String format for return
Return Convert.ToBase64String(ByteHash)
End Function
Private Sub btnChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChange.Click
Dim Doc As System.Xml.XmlDocument
Dim Writer As System.Xml.XmlTextWriter
Dim Reader As System.Xml.XmlTextReader
Dim theuser As String
theuser = GenerateHash(txtUser.Text)
Writer = New System.Xml.XmlTextWriter("C:\users.xml", Nothing)
Writer.WriteStartElement("user")
Writer.WriteStartElement("name")
Writer.WriteString(GenerateHash(theuser))
Writer.WriteEndElement()
Writer.WriteStartElement("password")
Writer.WriteString(GenerateHash(txtPass.Text))
Writer.WriteEndElement()
Writer.WriteEndElement()
Writer.Close()
Reader = New System.Xml.XmlTextReader("C:\users.xml")
Doc = New System.Xml.XmlDocument
Doc.Load(Reader)
End Sub
|
|
|
|
|
Does this look like a job posting forum to you?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
A web site I am using needs being regularly refreshed otherwise the site disconnects my session ( for security reasons) and I have to log in and enter my password again.
To keep being connected I just need to click on some hyperlink.
I would like to write a VB applet which would just do the click .
How can that be done?
aprx
|
|
|
|