|
You need to create an instance of the forms on each form before they can communicate
ex:
on form2
Public OldFrm As Form1
on form1
Dim NewFrm As New Form2<br />
Form2.OldFrm = Me
You need to do the second form first else it wont be recognized
Then you can call objets like this
on form1
NewFrm.MyDataset.MyTable("").Rows
Hope this helps
For every action there is an oposite and equal malfunction.
|
|
|
|
|
I believe that if you create the dataset in a module then you should be able to access it from any form you create in your project.
|
|
|
|
|
I'm using this code to play a wav file;
Public Shared Sub PlayWaveResource(ByVal WaveResourceName As String)<br />
<br />
' get the resource into a stream<br />
Dim resourceStream As Stream<br />
resourceStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("AssemblyName." + WaveResourceName)<br />
If resourceStream Is Nothing Then Exit Sub<br />
<br />
' bring stream into a byte array<br />
Dim wavData As Byte()<br />
ReDim wavData(CInt(resourceStream.Length))<br />
resourceStream.Read(wavData, 0, CInt(resourceStream.Length))<br />
<br />
' play the resource<br />
PlaySound(wavData, 0, SND_ASYNC)<br />
End Sub
but it's not playing the right sound, it plays the standard windows error sound instead
any ideas?
For every action there is an equal and opposite malfunction
|
|
|
|
|
i have been trying to upgrade the VB6 project that can be
found at
http://www.vbaccelerator.com/home/VB/Code/vbMedia/Audio/WAV_File_Viewer/article.asp
I have managed to get the majority done, using a combination of the upgrade
facility and some programming of my own. I have now unfortantly got stuck
with the following line of code:
copymemory(VarPtrArray(iWav), VarPtr(tSA), 4)
(copymemory being the standard API call to RtlMOveMemory in kernel32)
The problem i have is the VarPtr command, and to some extent the VarPtrArray
command. I need a solution for VBnet.
Background information:
tSA is variable of the following structure:
StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi) _<br />
Private Structure SAFEARRAYBOUND<br />
Dim cElements As Integer<br />
Dim lLbound As Integer<br />
End Structure<br />
<br />
StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi) _<br />
Private Structure SAFEARRAY2D<br />
Dim cDims As Short<br />
Dim fFeatures As Short<br />
Dim cbElements As Integer<br />
Dim cLocks As Integer<br />
Dim pvData As Integer<br />
VBFixedArray(1) Dim BoundsR() As SAFEARRAYBOUND<br />
Public Sub Init()<br />
ReDim BoundsR(1)<br />
End Sub<br />
End Structure
and is created just before the copymemory line by
Dim tSA As SAFEARRAY2D<br />
tSA.Init()
and propulated with
With tSA<br />
.cbElements = 2<br />
.cDims = 2<br />
.BoundsR(0).lLbound = 0<br />
.BoundsR(0).cElements = m_cWAVRead.ReadbufferSize<br />
.BoundsR(1).lLbound = 0<br />
.BoundsR(1).cElements = 2<br />
End With
iwav is created in the following method
Dim iWav() As Short
If you need any more information please email me at
adrian.game@nospamWarwick.ac.uk (please remove the nospam)
or reply to the post. I have both the orignal VB6 project, the VBnet project
created using the upgrade wizard and my
own semi working version.
Thanks for any help provide
Adrian
|
|
|
|
|
Can anyone help me?
I need to develop in VB.net a random number generator that can generate a lottery number selection equal to 6 numbers and a bonus number. Each number must be different from all other numbers. I am tying myself in knots trying to work this out.
Please help me!
Jarlath Gallagher
Western Connect
Derry
N.Ireland
|
|
|
|
|
When asking for help on homework questions its good to keep in mind that people shouldnt/wont just give you the code...this would defeat the purpose. It is also import to describe what you've tried, and be specific about the question you are asking. A general question like the above will often illicit zero response.
OK, now for some help I can try to provide given the info above. There are many ways to approach this problem, i'll go with the easiest (far from the best, and very far from the most efficient).
In PSEUDOCODE:
1) Generate a random number between 1-49
2) Store number in a searchable list (eg ArrayList)
3) Generate another random number
4) If the number generated by 3) is already in the list from 2) go back to 3) and try again
5) continue 3) and 4) until 6 numbers + 1 bonus number are in list (ie list.Count == 7)
There are undoubtable algo's that can do this much faster, which im sure you can find by searching for "Lottery number generator algorythm" - the above process is very simplistic and can be knocked up quickly.
|
|
|
|
|
Well i'll try this again;
I have created an array containing 7 randomly generated numbers. I want these numbers to be mutually exclusive i.e. same value only occur once.
I have tried to in VB.net programming develop a set of nested if..then statements to test each drawn number against each element in the array.
This process is fraught with difficulty and more often than not does not guarantee a list of exclusive numbers and duplicates do occur. Plus it takes 50 lines of code. Resource intensive!
Is there a more efficient code in VB.net that will validate the content of my array and ensure it is mutually exclusive.
Thank you for the help so far
J.Gallagher
Western Connect
|
|
|
|
|
I have a registration program which when you open the program a registration form appear telling the user to enter the specific number. If the user enter the specific number then he can use the Full program without again entering the registration number the second time he opens the program. I want to change the start up form from the registration form to the program directly! Can someone tell me the coding pls because I am in a big problem!
Thanks alot!!
ADRIAN De BATTISTA
|
|
|
|
|
You've written your application incorrectly. The Startup form should be your main application. When it starts, it should check to see if the program is registered. It should then call the registration form if needed. Once the application starts on a form, that form hold the message pump for the entire application. Once started, the message pump CANNOT be transferred to another form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
consider Dave is a dos game.
if we develop a graphics pgm in c it need BGI files to run this. how dave.exe running without that BGI files.
|
|
|
|
|
Your question has nothing to do with VB or VB.NET...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I make a Database in SQL SERVER which has 9 tables. I want to copy that database to another computer, how can i do this.
kindly tell me the procedures, so that i can transfer database to another computer, along with its inserted data
EsHbAn BaHaDuR
|
|
|
|
|
Your question belongs in the SQL/ADO/ADO.NET[^] Forum, since it has nothing to do with VB/VB.NET.
But, it is easy to export your entire database, data and all, to a SQL file using the Enterprise Manager.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How I do to create an without color (transparent) TextBox (or RichtextBox)?
I know what we can use transparent labels, but how we do with TextBoxes?
|
|
|
|
|
The TextBox class doesn't support transparency. You'll have to subclass the TextBox and add support for it, which is a HUGE pain. You can read up on it in this[^] article, by Bob Bradley, here on CP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I make a form in vb.net. I set its window state property to "Maximized". Means my form will open in "FULL SCREEN".
I also set property "Form Border style " to fixed, so that my form cannot be moved or resized.
But after applying properties, my form still be resized and movable. How can i restrict my form, so that it cannot be moved or resized.
Kindly reply me soon
Eshban
EsHbAn BaHaDuR
|
|
|
|
|
|
I have a collection that contains some deep objects (of other objects). I'd like to insert a new object into a location in the middle of the collection, which can't be done with .Add() since that adds to the end of the collection.
Does anyone have a particularly good suggestion for inserting objects at given locations into an existing collection?
|
|
|
|
|
It depends on the collection your using. Any collection that implements the IList interface should be able to do this, using it's Item property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How would you use the item() method to *insert* into the existing collection? Perhaps you're thinking that I'm trying to overwrite an existing item member--I actually want to insert a new item between two existing items.
Unless you're talking about a method of inserting that I'm unaware of?
|
|
|
|
|
My mistake. I was thinking of something else. But, an ArrayList[^] will do exactly what you want, with an .Insert method. My advise still applies, the IList interface exposes an .Insert method that a class must implement (and ArrayList does) to support Inserts at an Index.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want to include the installation of .net framework and msde along with my application(vb.net),
sothat in one click i want to install my application + msde + .net framework.
the o.s. of my target machines vary from win 98 to win xp
i tried with a vb script added in the custom action which will run the shell command to run
the msde setup. it is giving an error "Another Installation already in progress..." when i tried the
installation in Win 98 machine. I tried the same process in an Win XP machine which is giving
the error that the script cannot be run.
|
|
|
|
|
It can't be done from inside your application's .MSI. Since only one .MSI installation can run at any one time, you'll have to write your own Setup (not in a .NET managed lanugage!) to detect for and launch the appropriate installs.
But, this already exists. Search the web for "Setup Bootstrap". There's examples here on Code Project and on GotDotNet.com.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When I try the webservice sample code "hello world" in the Visual studio .net 2003, I seem always have problem on authetication or authoraztion. I just remove the "'" according to the explanation in the comment to change serveral line of comment into code. and Press F5 to debug it . or try http://localhost/webservice1/webservice1.asmx in the brower.
At first, I got an error "Access denied". I thought it may be ananymous access from ASPNET account or IUSR-XXX need administrator authorization. I put them into administrator group. But it does not work. I also put debugger users group and VS developer groups have administrator authorization. It does not work. I got some other server-side error as "The Web server reported the following error when attempting to create or open the Web project located at the following URL". I also change some setting on dedault web site of IIS as application protection to Low and put ASPNET account or IUSR-XXX, debugger users group and VS developer groups all have administrator authorization . But I do not know why. As the explanation in the help or book, it should not be so difficult.
My environment: window 2000 server, IIS 5.0 Visual studio .Net 2003.
My question is for the simpliest webservice. If i only try in the IDE, what
do I have to set?
My email address:Bretthlin@hotmail.com or linhchnn@yahoo.ca
llllhhhh
|
|
|
|
|
I'm wondering if a component is available that essentially will write basic classes for a user. Example the user provides the component with a database connection string and table name and the property class can be created based off that information. Additionally it would be nice if basic Get, Insert, Update, and Delete stored procedures could be created for the selected table. Does anyone know of a component that can do this?
Jason W.
|
|
|
|