|
how can i get an array of any control in visual basic to use them one by one by clicking one command button.
waiting for solution.thanx
|
|
|
|
|
What do you want to do ? VB6 or VB.NET ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am not sure I understand your question, and you need to specify what version of VB you are using.
In VB6 you can create arrays of controls and enumerate them like any array.
In VB.NET you cannot create arrays of controls, but you can add controls to the Controls collection of a form, a panel or a groupbox dynamically. You also can enumerate the control collections of any container (i.e. a form, panel, groupbox).
|
|
|
|
|
Is there an easy way to format a telephone number in a textbox on a form?
"(123) 456-7890" or point me in the right direction for something other than string manipulation.
currently reviewing MSDN string manipulation docs... being from big blue and old iron i would expect some simple ways to format input/return fields.
thanks in advance
|
|
|
|
|
You can use a reg ex validator to validate that this is the input you recieved. RegEx replace will let you enforce the () and - even if they were not there to start with.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how do i take A strings data
and take all the chars or substrings and store them Array INDividualy...
so say if the data in the string is HELLO THERE
take H and store it to index 0 E store it to index 1 and so on and so forth even the space between HELLO and THERE.
|
|
|
|
|
|
String has a ToCharArray method.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Strings have a "Chars" property array, which is the string split into an array of characters, just like what you are wanting. For Example.
<br />
Dim S As String = "Test"<br />
<br />
S.Chars(0)
S.Chars(1)
S.Chars(2)
S.Chars(3)
You can also use the "ToCharArray" function of a String to get a specific substring of the string and split it into a character array. For Example.
<br />
Dim S As String = "Test"<br />
<br />
S.ToCharArray(2, 2)
Hope this helps,
Scott
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem."
( President Ronald Reagan)
|
|
|
|
|
yes this helps a bunch.
so say if i wanted to do a loop that will stop as soon as i completed storing the chars in the array.
Dim S As String
S = "hello there"
Dim I As Integer
Dim Chars() as String
I = 0;
For i To S.Legnth Step +1 // don't know yet how i set that up
S.Chars(0);
Next do whateever...
i don't know how am i attemping this, loops are still fuzzy to me but I have some grasp.
-thanks
George
|
|
|
|
|
Hi
I need to have a program that creates a new desktop (on a local machine, and runs some applications in that desktop).
This desktop is not interactive to the users, but the administrator, should remotely be able to have this desktop (in interactive mode).
I want to know how this is possible.
Also if there are any ways that the administrator could have access to the current user desktop, I'd be glad to know that.
(The program is in VB6, but it's no matter if the answer be is VB.NET, C#, or C++)
Thank you.
|
|
|
|
|
This is not really a programnming issue but rather an OS issue. There are several programns already available that provide the functionality you describe.
You can use Microsoft Remote Desktop to access any computer which also has Remote Desktop properly configured, for any account which is configured and that you have a valid login for.
Remote Desktop does not allow you to access an account with the user concurrently logged in. For this you can use a program called RealVNC.
|
|
|
|
|
Hi,
I am developing an app in vb.net that relies on the presence of another application running at the time. Can anyone tell me how to detect if the other application is currently loaded,
Regards
Dundoan
|
|
|
|
|
Do a search on GetObject() from the Visual Studio help system. It will provide the information you need. In summary, an extract from the help is shown below. (Note this example is in VB 6.0 - you'll need to modify slightly for VB.NET.)
' Test to see if there is a copy of Microsoft Excel already running.
On Error Resume Next ' Defer error trapping.
' Getobject function called without the first argument returns a
' reference to an instance of the application.
' If the application is not running, an error occurs.
MyXL = GetObject(, "Excel.Application")
If Err().Number <> 0 Then ExcelWasNotRunning = True
Err().Clear() ' Clear Err object in case error occurred.
...Steve
|
|
|
|
|
how to connect visual basic 6.0 to sql sever 2000.i have both the sql sever and vb 6.0 both installed in my pc.i am doing a project which requires me to connect vb to sql sever and to the programming in vb using sql sever as a database.
so can anyone please help me to connect vb to sql sever please.
email: goundar_j@yahoo.com
|
|
|
|
|
Hi,
anyone know anyway of converting geographical coordinates to screen coordinates?
I have a world map, and I want to plot icons on it, but I first need to transform my longitude and latitude values to x,y values)
|
|
|
|
|
There is any way to show a tooltip within the need of stop the mouse over a control?
For example show the tooltip when a timer counts to 5 seconds...
Thanks
|
|
|
|
|
Yes. Use the Tooltip control.
Add it to the form.
Then to add the tooltip:
myTooltip.SetToolTip(MyControl,"This is the text")
where myTooltip is the tooltip you created above and myControl the one you want the message associated with. If you look in the doc you can also specify the timing.
|
|
|
|
|
Yes, I know. But this tooltip will show when user stops the cursor over the control.
I want to show it with no action from the user.
Thanks anyway
|
|
|
|
|
You really have to read the documentation for the Tooltip[^] class. There are properties that let you control how fast the Tooltip shows up (by default, a half second), how long it stays displayed, and others.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
But that I want is to show the tooltip without the cursor.
Maybe I'm not explaining well...
I'm reading the link you share and in one of the first lines says
"The ToolTip class allows you to provide help to users when they place the mouse cursor over a control."
I think that this explanation answer my question. It's not posible to show the tooltip if the cursor don't moves over him.
|
|
|
|
|
ecentinela wrote:
It's not posible to show the tooltip if the cursor don't moves over him.
Nope. That's not the defined behavior of the ToolTip component. If you want Tooltips showing over all of your controls without the mouse being anywhere near them, you'll have to draw the ToolTips yourself. This is not a good idea though. You'll end up cluttering your user interface with all kinds of information that the user doesn't need when they become familiar with your app.
Think of if this way. Have you ever seen a Windows application that does this? Why not? Because the user interface was (hopefully!) well thought out to begin with. It should be intuitive to use without all the help showing on every control.
If you want to show a little help with whatever control the mouse passes over, other applications tend to put a short message in the status bar of the application window describing the functionality of that control.
The Windows user experience should be consistant acrossed all, or most, of the applications the user runs. If you deviate from the accepted, and more importantly defined norm's in the Windows User Interface Design Guide, you'll end up confusing the user more than you think you're helping them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am in the process of moving my pages from asp to aspx and I ran into a snag. I have an order form that I use to place items into a Yahoo shopping cart. To do this, I have 2 forms on the old asp page each having an item. When I moved this code over to the aspx page, I found that the first form just posts back to the aspx page but the second works fine. More over, when I put a blank form before the two original forms they both work fine. It seems only the first form does not work. This is a workaround for the problem but I would like to know what is going on. Please let me know!
Regards:
For example:
<body>
<form
id="Form2"
method="post"
runat="server"
>
--- This Form Posts Back to the aspx page
<form
method=post
Id=frm02
Action="http://order.store.yahoo.com/cgi-bin/wg-order?mysite"
>
<input
Name=vwcatalog
Type="hidden"
Value=mysite
>
<input
Name=vwitem
Type="hidden"
Value=item1
>
<input
Name=vwquantity
Type="hidden"
Value=0
>
<input
Class="submitbutton"
Value="submit"
Type="image"
src="http://mysite.org/images/CmdButton-AddMeToThisEvent-2F8DBE.gif"
id="btn1"
width="190"
>
</form>
----This form works fine ---
<form
method=post
Id=frm03
Action="http://order.store.yahoo.com/cgi-bin/wg-order?mysite"
>
<input
Name=vwcatalog
Type="hidden"
Value=mysite
>
<input
Name=vwitem
Type="hidden"
Value=item2
>
<input
Name=vwquantity
Type="hidden"
Value=0
>
<input
Class="submitbutton"
Value="submit"
Type="image"
src="http://mysite.org/images/CmdButton-AddMeToThisEvent-2F8DBE.gif"
id="btn2"
width="190"
>
</form>
</form>
</body>
Steve
|
|
|
|
|
ASP.NET works by creating it's own form, you need to rewrite this to not use two forms.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for the reply!!
Is there any reason you can think of for why the complier does not put up a fuss when you add form tags or that the page seams to work when you put a blank form in frount of the other two?
Cheers:
Steve
|
|
|
|