|
thanks for your response. That what i have done but generate error or did not give showDialog method when i call my instance.
see my code
Private Sub RestoreToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestoreToolStripMenuItem.Click
Dim frmSecondMenu As New SecondMainMenu
frmSecondMenu. (this did have showDialog in the list of methods)
End Sub
if i type it as frmSecondMenu.ShowDialog() i have the following error
Error: Error 9 'showDialog' is not a member of 'System.Windows.Forms.SecondMainMenu'.
what will i do
|
|
|
|
|
Hi,
I want to call a private function (We can make the function public.) in VB.Net (The project type is windows application) from visual basic 5. VB.Net application is set up as an exe.
I appreciate your early response.
Rgds,
Rains
|
|
|
|
|
Your options are to make the VB.NET project a COM object ( can that be done with an exe ) or using WM_COPYDATA and interop, or some other messaging mechanism.
Making the function public won't help, VB5 is even more obsolete than VB6, it can't speak .NET.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
VB.Net project is an exe. we cant make it as a dll..it has a user interface...
can we tweak the code so that depending on from where it is called we can either call the form load or the function??
|
|
|
|
|
plz anyone answer my question
|
|
|
|
|
What specifically is your problem?
|
|
|
|
|
take you pick VB6, Crystal Reports, either one is a show stopper. Oh yeah and idiot on the keyboard.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i have developed project in vb 6.0 &report:crystal report database ms access 2007.each and every time report not fully display it ask refresh.then only i got fully report.thats my problem
|
|
|
|
|
You didn't ask one. Configure it, how ? Why would a product released in 2008 have the ability to talk to a product that became obsolete six years before ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i have developed project in vb 6.0 &report:crystal report database ms access 2007.each and every time report not fully display it ask refresh.then only i got fully report.thats my problem
|
|
|
|
|
I am trying to when I click on a name in linkbox1 to show all the data in access database table in my texboxes.
But it gives me this error "No value given for one or more required parameters"
Here are my Code. Don't know why it is not working
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim SqlStr As String
SqlStr = "Select * from tblokkies where luidraad = " & ListBox1.Items(ListBox1.SelectedIndex)
FillTextBox(SqlStr)
End Sub
Public Function FillTextBox(ByVal Sqlstring As String)
Dim OleDbConn As OleDbConnection = New OleDbConnection(ConnString)
OleDbConn.Open()
Dim MyDataReader As OleDbDataReader
Dim MyOleDbCommand As OleDbCommand = New OleDbCommand()
MyOleDbCommand.Connection = (OleDbConn)
MyOleDbCommand.CommandText = Sqlstring
MyDataReader = MyOleDbCommand.ExecuteReader
Try
Do While MyDataReader.Read
TxtLuidraad.Text = (MyDataReader.Item(1))
txtA1.Text = (MyDataReader.Item(2))
txtA2.Text = (MyDataReader.Item(3))
txtA3.Text = (MyDataReader.Item(4))
txtA4.Text = (MyDataReader.Item(5))
txtA5.Text = (MyDataReader.Item(6))
txtA6.Text = (MyDataReader.Item(7))
txtA7.Text = (MyDataReader.Item(8))
txtA8.Text = (MyDataReader.Item(9))
txtA9.Text = (MyDataReader.Item(10))
txtA10.Text = (MyDataReader.Item(11))
Loop
Catch err As System.Exception
MyDataReader.Close()
OleDbConn.Close()
OleDbConn.Dispose()
End Try
End Function
|
|
|
|
|
Wow, is your code ever illegible. Is this deliberate ?
What type is luidraad ? Should the item be in quotes ? What line is blowing up ?
Have you stepped through the code to see if the returned data has that many items in it ? Does VB really index by 1 instead of by 0 ? I guess it would.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Sorry my engilsh is not so good, what do you mean by illegble and deliberate.
Is there onther way do this this codeing.
Luidraad type = text (150)
No quotes
Can not see waht line is blowing up.
Did step true here is what I get when I press F8.
1. Click on 4th entry in listbox1 (Hendrik)
2. Dim Sqlstr as string (Sqlstr Nothing)
3. After F8 = Dim Sqlstr as string (Sqlstr "Select *from tblokkies where luidraad=Hendrik")
4. listbox1.items(listbox1.selectedindex) (Listbox1.items {System.Windows.forms.listbox.objectcollection)
5 After F8 = listbox1.items(listbox1.selectedindex) (Listbox1.selectedindex 4)
6. Filltextbox(Sqlstr) (Filltextbox Nothing)
7. Dim Oledbconn as oledbconnection = new oledbconnection(Connstring)
(OleDbConn {system.data.oleDbConnection}
(ConnectionString "Provider=microsoft.jet.oledb.4.0;data source=c:\blokkies\blokkies.mdb"
(ConnectionTimeout 15
(Conteiner nothing
(Database ""
(DataSource "c:\blokkies\blokkies.mdb"
(Provider "Microsoft.jet.oledb.4.0"
(Serverversion {"invalid operation. The connection is closed"}
(Site Nothing
(State Closed {0}
8. dim myoledbcommand nothing dbconn
9. after F8
(Myoledbcommand {system.data.oledb.oledbcommand}
(commandtext ""
(Commandtimeout 30
(commandtype text {1}
(connection nothing
(container nothing
(designtimevisible true
(parameters {system.data.oledb.oleparametercollection}
(Site nothing
(transaction nothing
(updatedrowsource both {3}
10. myoledbcommand.connection = (oledbconn)
(OleDbConn {system.data.oleDbConnection}
(ConnectionString "Provider=microsoft.jet.oledb.4.0;data source=c:\blokkies\blokkies.mdb"
(ConnectionTimeout 15
(Conteiner nothing
(Database ""
(DataSource "c:\blokkies\blokkies.mdb"
(Provider "Microsoft.jet.oledb.4.0"
(Serverversion "04.00.0000"
(Site Nothing
(State open {1}
11. myoledbcommand.commandtext =sqlstring = myoledbcommand.commandtext ""
12. After F8 =sqlstring = "select*from tblokkies where luidraad=Hendrik"
= myoledbcommand.commandtext = "select*from tblokkies where luidraad=Hendrik"
13. Mydatareader = myoledbcommand.executereader = nothing
after thisd it gives me the error.
Hope this help, I don't understand it quit yet.
|
|
|
|
|
hendrikbez wrote: 12. After F8 =sqlstring = "select*from tblokkies where luidraad=Hendrik"
= myoledbcommand.commandtext = "select*from tblokkies where luidraad=Hendrik"
I think Hendrik must be enclosed with '.
SqlStr = "Select * from tblokkies where luidraad = '" & ListBox1.Items(ListBox1.SelectedIndex) & "'"
try with select * from tblokkies where luidraad='Hendrik' from Access
|
|
|
|
|
celso_cabaleiro Thank you it is working.
I don't know how to do it, can you help me with this please
I want to use txtluidraad.text to do a search, and then when I type in the word, listbox must go to that one, must I add a new listbox or will the one that I have work. I don 't know how to use a search at all. Hope you can help me.
|
|
|
|
|
Hi all...
I am creating a one-to-one chat program for communication over LAN. I have done almost except one thing. When a user(1) wants to chat another online user(2), he clicks on his name and opens a private chat window. Now when user(1) types msg and click on send button then msg send to user(2).
Now the main thing I want to do is that when user(1) sends msg to user(2) through private chat window, same private chat window will automatically appear on user(2)'s computer screen if that window is not opened (same as other chat program like Y! Messenger,GTalk etc).
Suggest me how can I do this.
Thanks.
Gagan
|
|
|
|
|
The same way they do it. Have your app already running in the taskbar and listening for messages.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Yes....My application is running at taskbar and listening for incoming messages,joined and left users etc.
Suggest me how can I do that.
Thanks.
Gagan
|
|
|
|
|
I don't understand. You said it's doing htat already, then you say 'suggest how to do that' ? Which bit are you not doing ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Chatting is not in progress but a method used for configuring joined and left users. When an online user(1) sends message to another online user(2) then, because user(2) don't have an open private chat window with user(1),it will automatically open that private chat window with user(1).
Hope now you will understand my problem.
Gagan
|
|
|
|
|
Hi all,
Newbie question: I've been trying to get my VB.NET application to start recording from the mic when I press a button. I'm afraid my programming is very beginner (and consists largely of cut-and-paste). I have found a few examples of code online, but they are usually written in C. The one example I could find in VB.NET (below - from MSDN) seems simple but it doesn't work - am I missing something obvious? Do I need to put another "Imports ...." at the beginning? Should I be adding a component? Any help would be really, really appreciated - I've been trying for days.
Thanks!
Mark
Here's the code:
Imports Microsoft.VisualBasic.Devices
Imports Microsoft.VisualBasic
Imports System.Runtime.InteropServices
Public Class Form1
Private Shared Function mciSendString(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' record from microphone
mciSendString("open new Type waveaudio Alias recsound", "", 0, 0)
mciSendString("record recsound", "", 0, 0)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
' stop and save
mciSendString("save recsound c:\record.wav", "", 0, 0)
mciSendString("close recsound ", "", 0, 0)
Dim c As New Computer()
c.Audio.[Stop]()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim computer As New Computer()
computer.Audio.Play("c:\record.wav", AudioPlayMode.Background)
End Sub
End Class
|
|
|
|
|
I am trying to use some WinAPI commands that want to be passed an hIcon but both the handle property of an icon and the bitmap class's toHicon don't seem to work. Any help please?
|
|
|
|
|
What's the function you're calling?? What does your Declare statement look like? What does the code you have calling this function look like?
|
|
|
|
|
A VB.net app I'm building needs to process very long lists stored in .txt files. My problem occurs when I attempt to avoid duplicate entries while merging lists. Most of the lists go quickly, but the largest (the largest to date has 190,000 lines) take forever. I don't expect that much data to process instantly, but I would like to speed things up. Here's how I'm doing it at present:
' "lbSelFiles" is the listbox containing paths to the files to be processed.
' the "sr" streamreader reads each line of each file. If the line isn't already
'in the collection (addList), it adds it.
' The "getLines" array's only purpose is to provide a max value for the progress bar (progBar).
addList.Clear()
For l = 0 To lbSelFiles.Items.Count - 1
If File.Exists(lbSelFiles.Items.Item(l).ToString) Then
Dim getLines() As String = File.ReadAllLines(lbSelFiles.Items.Item(l).ToString)
progBar.Maximum = getLines.Length
progBar.Value = 0
Dim sr As New StreamReader(lbSelFiles.Items.Item(l).ToString)
Dim line As String
Do
line = sr.ReadLine()
'this appears to be the bottle neck
If Not addList.Contains(line) Then
addList.Add(line)
End If
progBar.Increment(1)
Loop Until line Is Nothing
sr.Close()
End If
Next l
'this copies addList to an array, then sends the array to a richtextbox
'the form containing this code then closes
Dim arr(addList.Count) As String
addList.CopyTo(arr, 0)
Dim newRTF As RichTextBox = CType(main.ActiveMdiChild.Controls(0), RichTextBox)
newRTF.Lines = arr
Me.Close()
Any suggestions on a better (faster) way are appreciated.
|
|
|
|
|
Alan Burkhart wrote: 'this appears to be the bottle neck
If Not addList.Contains(line) Then
erm... well... this is going to iterate over the *entire* list, looking for this value. So, of course it's going to be slow. I'd suggest you build an alphabetised version of the list. That way, you can do a more intelligent search ( for example, you could use a dictionary to create lists that mean you only iterate through the items with the same first letter, or you could start in the middle and search alphabetically by grabbing the middle every time of the appropriate half )
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|