|
How can I specifically read a word placed between quotes ("word") from a line of text.
|
|
|
|
|
Dim first As Integer = Trim(TextBox1.Text).IndexOf("""") + 1<br />
Dim last As Integer = Trim(TextBox1.Text).LastIndexOf("""")<br />
<br />
Label1.Text = Trim(TextBox1.Text).Substring(first, last - first)
This will only work with one set of quotes, I'll work on a little parser and get back to you.
|
|
|
|
|
I would have thought that the easy way, would be compare....
the word you want to look for is "word"
the user types in "this word would be nice" includes the "word" you are looking for.
|
|
|
|
|
hello
I'm opens a form (Access 2003) using a tmptable and show the content of it correctly. but, I get the last line ( table.EOF line?) with an empty line in the form also.
when looking in the tmptable - the last line is empty too. how to avoid display this line?
thanks in advance
evyatar
|
|
|
|
|
How do I check to see if a text box is empty or has multiple blank spaces.
|
|
|
|
|
Try this:
<br />
If TextBox.Text <> "" Then<br />
'Code goes here<br />
End If<br />
|
|
|
|
|
this will remove all white space before and after.
If Trim(Textbox.text) <> "" Then
......
End if
|
|
|
|
|
Thanks AreJay this solved the problem.
|
|
|
|
|
Hi,
I want to determine from my vb.net code which background process(application) is running in full screen mode. I got all process details using the system.diagnostics...but how to go about determining whether the process is in full screen or not???
Thnx in advance
|
|
|
|
|
Try this:
<br />
If Me.WindowState = FormWindowState.Maximized Then<br />
'Code goes here<br />
End If<br />
|
|
|
|
|
actually let me explaina bit more, here is the scenario:
My application is running
In the background i have for example, msn messenger, corel draw, a power point presentation running...
usually a power point presentation runs on full screen.
so in my code, i need to determine which application OUTSIDE of my application is currently active IN full mode...i.e i want to determine that powerpoint is running....
thnx in advance
|
|
|
|
|
If it's not an app you write, you'll have to use the WIn32 API functions GetWindow, FindWindow, and/or FindWindowEx to get the window handle you're looking for, then call GetWindowPlacement[^] to get the current state of the window.
You can look on http://www.pinvoke.net[^] for examples on how to call these functions.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dear Sirs,
Could any one help me how to send a String from one application to other application in VB.NET.
Thanking You.
Hariram
|
|
|
|
|
This depends on the other applicaiton. You can't just "send a string" to an application. If it's not expecting it the way you're sending it, you may as well be talking to the wall.
You'll have to explain the situation in greater detail, like how the other app expects this string and what your trying to do with the string, to get any kind of an answer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have a dll that defines public properties within a class. These will be set from an external application. Within that dll, I am creating another class, and want to either pass in the properties, or make them accesible from the new class. However, when I try to pass in class A to class B, I get into an infinite loop. I am also not able to access Class A's properties from within Class B. Class A is Public, class B is private. Is there something special I need to do to access Class A props from within Class B?
|
|
|
|
|
Good day everyone,
I need to update a record into the database Access via table adapter in VB.net 2005.
The dataset is updated, but the record in the database Access is not.
Could anyone knows how to fix this problem?
Please help.I'd appreciate it so much.
Thanks
(Student_Details:table name)
MyDataSet.Student_Details.Rows(2).Item(3) = "new password"
MyDataSet.GetChanges(DataRowState.Modified)
Student_DetailsTableAdapter1.Update(MyDataSet)
MyDataSet.AcceptChanges()
Me.Validate()
Me.Student_DetailsBindingSource.EndEdit()
Me.Student_DetailsTableAdapter1.Update(Me.MyDataSet.Student_Details)
-- modified at 11:11 Saturday 14th October, 2006
eric
|
|
|
|
|
How can i create file that contains Text and Picture in it...
And than read in vb.net picture in picturbox and text in text box and if something is changed than save it...
|
|
|
|
|
I'm writing an app in VB.net with .NET 2. The application has a main form plus two other forms. When I click Exit-button on the main form, I call Me.Close(). After that MainForm_Closing routine handles the shut-down procedures. Ultimately I call Application.Exit(). The problem is that although the main form dissapears, application (.exe) keeps reserving system resources (95%!). How to close the application completely? I think the problem is that the two other forms are not closed, but hidden.
|
|
|
|
|
on your form put button "Exit" in exit buton type like this:
Private Sub cmdEnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdEnd.Click<br />
Me.Close<br />
Me.Dispose<br />
End Sub
and if you have to save anny data before closing, do it in "Form close event"
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing<br />
'Saving data<br />
System.IO.File.Create(Application.StartUpPath+"\data.ini")<br />
End Sub
------------------------------------------------------------------
Just be shure that u dont type on some other button which is suposed to end aplication that you type "End". Allways use "Me.Close"
------------------------------------------------------------------
Hope it helps! :->
|
|
|
|
|
Are you holding an unmanaged resources open that you should have Disposed? Started any threads that you didn't stop? Used a COM component that you didn't shutdown?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Usually Application.Exit() is enough to close the process completely. If not, try to close all other forums with the .Close method.
|
|
|
|
|
Not exactly. If you leave running resources, like a thread not set as Background, it'll stay running and visible in TaskManager, regardless of how you exit the app.
If you don't do anything like this, leaving unmanaged resources orphaned, then Application.Exit will do what you expect it to.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
My application is very simple, so I _think_ I haven't open any additional resources. MidiOutOpen is called when main form is loaded, but I close that in the MainForm_closing event.
I'm a beginner and I don't know what are threads. Can you please explain me? Still, I can see that two threads are left open even though application should have been shutdown. How to close all threads? Are active timer components threads?
What does the "Me.Dispose" command do? It didn't help though.
|
|
|
|
|
re infecta wrote: My application is very simple, so I _think_ I haven't open any additional resources.
Even the simplest of applications can have the biggrest of problems.
Since you're using a Midi library, you're more than likely using unmanaged resources.
re infecta wrote: MidiOutOpen is called when main form is loaded, but I close that in the MainForm_closing event.
You might want to check with the documentation of this library to see if your shutting it down properly. You can Open and Close it, but is this the correct procedure for using it??
DOn't worry about threads. If you didn't launch any, and you'll know if you did, you don't have the responsibility of managing them.
Don't do Me.Dispose . That tell's the current object, more than likely your form, to kill itself! This MAY be the cause of your problem...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What is the difference between the following :-
Application.Exit()
Me.Close
End
in ending a program.
|
|
|
|