Hi, another newbie question here. Believe it or not, I've got something
that's pretty slick in that it gets the name of all running apps and
populates a combobox. What I want to do is test to make sure I can do
something with it, so I just want to put it out to a label I ahve on the
form (this is just for a test, the label won't be in the finished product,
I gess I could use a message box as well).
Here's my code:
Private Sub btnGetIt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnGetIt.Click
Dim objProcess As Process
For Each objProcess In System.Diagnostics.Process.GetProcesses
If objProcess.MainWindowTitle <> "" Then
cboProcessesList.Items.Add(objProcess.MainWindowTi tle)
End If
Next
lblSelectedApp.Text = cboProcessesList.SelectedText.ToString
End Sub
OK, I know that last line before the End Sub is lame, but I just want to be
able to put the selected app out to a label. I figure, if I can do that I
can do a lot with it. It's late here (after midnight) and I'm low on
ideas. 1 899
* "Hogan's Goat" <ye**@right.com> scripsit: Hi, another newbie question here. Believe it or not, I've got something that's pretty slick in that it gets the name of all running apps and populates a combobox. What I want to do is test to make sure I can do something with it, so I just want to put it out to a label I ahve on the form (this is just for a test, the label won't be in the finished product, I gess I could use a message box as well).
Here's my code:
Private Sub btnGetIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetIt.Click Dim objProcess As Process For Each objProcess In System.Diagnostics.Process.GetProcesses If objProcess.MainWindowTitle <> "" Then cboProcessesList.Items.Add(objProcess.MainWindowTi tle) End If Next lblSelectedApp.Text = cboProcessesList.SelectedText.ToString
'SelectedText' returns a 'String', you don't need to call 'ToString'.
Maybe you want to use this code instead:
\\\
lblSelectedApp.Text = cboProcessesList.SelectedItem.ToString()
///
OK, I know that last line before the End Sub is lame, but I just want to be able to put the selected app out to a label. I figure, if I can do that I can do a lot with it. It's late here (after midnight) and I'm low on ideas.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Dilbert's words of wisdom #18: Never argue with an idiot. They drag you down
to their level then beat you with experience. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Wayne Wengert |
last post by:
I am trying to populate a combobox with a lisy of items. I want the 1st item
to be "Make a Selection" and the following items will be names from a table
in my DB (See code below).
When I run the...
|
by: Steve |
last post by:
I have a continuous form with several unbound comboboxes in the form header. The
comboboxes are used to provide criteria for the SQL of the form. The code behind
the form looks like:
Public Sub...
|
by: Steve |
last post by:
I have an unbound combobox in the form header of a continuous form. The
selection in the combobox sets the where clause in a querydef which determines
QryPFrmInventoryManagement. The following code...
|
by: George Hartas |
last post by:
I am using Visual C# .NET 2003 to make a ComboBox accept
both mouse and keyboard selection. For mouse selection
code, I double-clicked ComboBox to get the
default "comboBox1_SelectedIndexChanged"...
|
by: Hiroyuki Tanaka |
last post by:
Hi All,
I am trying to develop an application for a touch screen using buttons
for the numeric pad with Completion ComboBoxes.
At the moment I am having a problem sending the button presses to...
|
by: Ivan V via DotNetMonster.com |
last post by:
Hi All:
I would like to know if I can loop my selection in a combobox. For
instance, I got 8 items in a combobox, and when I selected it using the up
and down arrow, it will stop in the first...
|
by: =?Utf-8?B?Q2hyaXM=?= |
last post by:
I am trying to populate a DataGridView Combobox column with a different data
binding source (dataset) depending upon a selection made in a previous
column. I can handle the previous column but how...
|
by: The.Daryl.Lu |
last post by:
Hi, two parts to my problem if someone can help address either one or
both:
1. I want to SELECT everything in the table if it matches the
criteria when the query button is pressed (this is just...
|
by: billa856 |
last post by:
Hi,
My project is in MS Access.
In that I have one Form in which I have some Comboboxes.
1st one is Independent,
2nd one is dependent on first one,
3rd one is dependent on 1st and 2nd both....
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |