|
I have the array almost completed and stored array code in module (Bits of the code here):
<quote>Public txtRemainingBalance(10) As String
Public txtCustomerName(10) As String
Public txtAddress1(10) As String
Public txtAddress2(10) As String
Public txtAddress3(10) As String
Public txtRegNo(10) As String
Public txtCarModel(10) As String
Public ComboBox1(10) As String
Public txtPurchasePrice(10) As Decimal
Sub CalltxtCustomerName()
txtCustomerName(0) = "Not Defined"
txtCustomerName(1) = "Not Defined"
txtCustomerName(2) = "Not Defined"
txtCustomerName(3) = "Not Defined"
txtCustomerName(4) = "Not Defined"
txtCustomerName(5) = "Not Defined"
txtCustomerName(6) = "Not Defined"
txtCustomerName(7) = "Not Defined"
txtCustomerName(8) = "Not Defined"
txtCustomerName(9) = "Not Defined"
End Sub
Sub CalltxtAddress1()
txtAddress1(0) = "Not Defined"
txtAddress1(1) = "Not Defined"
txtAddress1(2) = "Not Defined"
txtAddress1(3) = "Not Defined"
txtAddress1(4) = "Not Defined"
txtAddress1(5) = "Not Defined"
txtAddress1(6) = "Not Defined"
txtAddress1(7) = "Not Defined"
txtAddress1(8) = "Not Defined"
txtAddress1(9) = "Not Defined"
The "Sub CalltxtCustomerName" and similar names just hold the "Not defined" text that displays when array is run.
On my third form, I have list boxes that display whats in the array in listboxes. Here is the code on the display button on that form:
<quote> ListName.Items.Clear()
ListAddress1.Items.Clear()
ListAddress.Items.Clear()
ListPostcode.Items.Clear()
ListCarReg.Items.Clear()
ListCarModel.Items.Clear()
ListCarCost.Items.Clear()
ListCarMake.Items.Clear()
Dim i As Integer
For i = 0 To 9
ListName.Items.Add(txtCustomerName(i))
ListAddress1.Items.Add(txtAddress1(i))
ListAddress.Items.Add(txtAddress2(i))
ListPostcode.Items.Add(txtAddress3(i))
ListCarReg.Items.Add(txtRegNo(i))
ListCarModel.Items.Add(txtCarModel(i))
ListCarCost.Items.Add(txtPurchasePrice(i))
ListCarMake.Items.Add(ComboBox1(i))
Now, all I want to do is on the form 1 and 2, make a button that stores whats in the text boxes and addes it to the index of the array, txtAddress1, txtAddress2 etc.. and adds that info into the next index number of the array and then clears the text boxes so that more data can be input and so on. I looked for examples, but can't find any. Any help would be appreciated.
In the end we're all just the same
|
|
|
|
|
Hi evrybody,
I want to create a program to play a sound or video stream by windows media player com object (= wmp) .
I have a wmp in my windows form.
I have a stream from that file(sound or video) not a path(file address on HD) .
I wery tried to find out some thing about this problem in internet.
----------------------------
hope to your help.
?
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
You cannot use the WMP to play from a stream in memory. It has to play from a file.
|
|
|
|
|
my problem in my programm is that i have a stream containig video or sound and i want to play it in my windows app via windows media player control .
this code can tell windows media player (=wmp) to play a file in internet
AxWindowsMediaPlayer1.Url = "some address";
this code meaning that wmp can play a video or sound streamly .
and my question is how can i play my stream when it is in memory ?
i find something about creating protocols to do something like the url passing to wmp
hope to your help.
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
For the second time, you can't. WMP will NOT play from a MemoryStream in your code. You MUST use a different control to do this, but I don't know of any.
|
|
|
|
|
|
Ive been searching through my ebooks and google literally for 5 hours now looking for a solution! Can anyone guide me on how to select a particular tab in a 3rd party application, either by the index number, or the tab name?
This selects the window I want to interact with:
<br />
Private Sub Button1_Click(...) Handles Button1.Click<br />
Dim Window As String<br />
Window = "PetDeviceMainDlg"<br />
AppActivate(Window)<br />
SendKeys.SendWait("%{F6}")<br />
End Sub<br />
And Ive tried every variation of this code from the MSDN (http://msdn2.microsoft.com/en-us/library/cdc8ebh8.aspx) that I can think of:
<br />
Private Sub Button1_Click(...) Handles Button1.Click<br />
<br />
Dim Window As String<br />
Window = "PetDeviceMainDlg"<br />
AppActivate(Window)<br />
SendKeys.SendWait("%{F6}")<br />
SelectTab(6)<br />
<br />
End Sub<br />
<br />
Public Sub SelectTab(ByVal index As Integer)<br />
<br />
Dim instance As New TabControl<br />
instance.SelectTab(index)<br />
<br />
End Sub<br />
When I debug, index does equal 6, but I get the error 6 isnt valid for index.
Any help would be much appreciated.
|
|
|
|
|
Tekkie wrote: Dim instance As New TabControl
instance.SelectTab(index)
A New TabConrol won't have any pages.
Seems like you are trying to select a Tab page in another application, correct?
If so, the SelectTab(6) is executing against your application and not the intended target application.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
If I take out the "new" i get the error "'instance' is used before it has been assigned a value". Im not sure why I had new in there, just picked it up from one of the google articles I think. How do I get it to keep focus on the other application? "Me." is for the VB form right?
Thanks
|
|
|
|
|
I think you miss the larger picture.
You can use SendKeys to send key strokes to another window.
But you can't write code in your application that executes in another window, especially if it's in another process.
Your tab selection code is running locally in your application but can't effect the other application or window.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Im going about this the wrong way then, I just want to either scroll through tabs using ctrl + tab until I hit the right one, or just activate TabIndex 9. I know it can be done because I have a program written in VB6 that does exactly what I want, using a combination of SendKeys and FindWindow. I just figured since tab index is constant that would be the fastest and most reliable way to accomplish this. I'll see if I dont have better luck tomorrow.
|
|
|
|
|
Are you using Vista?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Win XP SP2. I think the answer is in using the user32 API, but Im not knowledgeable enough to know what Im doing yet. My 3 hour video tutorial didnt get into this haha.
Too bad its not as simple as the script language I use... "WinActivate, PetDeviceMainDlg, Manual" Done
|
|
|
|
|
The reason I asked about Vista is because the VB.NET and VB SendKeys function no longer works on Vista like it used to. There are aricles out there for a replacement that does work on Vista.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Ok, since there is obviously no practical way to pick a tab, how do I go about using a loop? Something like
<br />
While "ActiveWindow" <> "GetInfo"<br />
SendKeys.SendWait("^{TAB})<br />
Wend<br />
|
|
|
|
|
Since I can see what you are seeing I'm not sure. But trying different things can't hurt.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Here is the application Im trying to automate. Basicly, switch to a window, send a modem command/string, switch to another window and click a button, switch to another window and verify some text, etc. There has to be some easy way to switch between the 20 tabs in SysTabControl32. Im pulling my hair out here trying to figure it out though.
http://img110.imageshack.us/img110/4738/tabslr5.th.jpg
|
|
|
|
|
The questions seesm to be, how does tab switching work in the other application?
Hot keys, mouse clicks, menu choices? How do you know what tab is currently selected?
Just trying to use the TAB key could be difficult because your program won't know where 'FOCUS' is in that program. If 'FOCUS' is in a TextBox control and you start sending keys to the application that could be a big problem for you.
I'm sure you have read this on MSDN.
http://msdn2.microsoft.com/en-us/library/ms171548.aspx[^]
The image is super small, 150x150. Any change to see it full size?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hello,
I would like to Change control color dynamically, every time I am sending in the following function another control (Button, Label,...) and change the backcolor of it.
I trying to do the following:
Private MyCtrl as New Object
Public Sub ChangeControlColor(ByVal _MyCtrl As Object)
Dim t As System.Type
t = _MyCtrl.GetType()
CType(MyCtrl,t).backColor=Color.red
End Sub
I got message that t is not defined(the last line: "CType(MyCtrl,t).backColor=Color.red")
Please help
Shay Noy
|
|
|
|
|
You can't use a variable as type specificaiton in a CType function call.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
I think you're looking for this:
Public Sub ChangeControlColor(ByVal c As Control)
c.BackColor = Color.Red
End Sub
Which is pretty pointless considering you can just change the backcolor of the contorl from the place you were going to call this anyway.
|
|
|
|
|
|
im doin a convertion from hex to ascii.the formula is working fine.but the is one problem whereby if the input is 00.its cant be display in the output..eg input="101010" the output="..." but for 1001 the output only ".".how could is resolve this?
|
|
|
|
|
1 - try to use an intelligent header, everyone here needs help
2 - try posting your code if you have a question about code you wrote.
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 )
|
|
|
|