Button control question

G

Guest

Hello All, this is my first post. I usually find answers to my questions
here, but seem to be stuck here on a problem. I am requesting help setting up
a small project I want to create for work.

1. We have many servers we are mapped to at startup, and each server
contains folders with different files that we need access to. I would like to
create a tabbed form with Command Buttons which when clicked would open up
the specified path.

2. On the second tab, I would like to create Command buttons, which would
have hyperlinks to various web sites we frequent, our intranet sites, etc.

I have created this in Access, but since everyones paths would be the same,
by creating this app I could load on everyones computer ( some computers do
not have access ( we still use Lotus apps)

I have created in VB.net the form, tabs, and buttons, but I am having
trouble setting the buttons properties to the file path or hyperlink. If this
needs to be code generated in the click_event, could someone point me in the
correct direction.

Sorry so long, just wanted to give accurate information. Thanks to all that
replys.

Mark
 
L

Leon Mayne [MVP]

BigBass1 said:
Hello All, this is my first post. I usually find answers to my
questions here, but seem to be stuck here on a problem. I am
requesting help setting up a small project I want to create for work.

1. We have many servers we are mapped to at startup, and each server
contains folders with different files that we need access to. I would
like to create a tabbed form with Command Buttons which when clicked
would open up the specified path.

2. On the second tab, I would like to create Command buttons, which
would have hyperlinks to various web sites we frequent, our intranet
sites, etc.

Hello,
You just need to execute an external application using the parameter of the
address you want to go to. To execute an external program, add the below
using / import line:

using System.Diagnostics;

Then drag a process control to your form (from the Components tab) and name
it e.g. p. Then add code similar to the below to your button_click event for
opening a hyperlink:

p = new Process();
p.StartInfo.FileName = "iexplore.exe";
p.StartInfo.Arguments = "http://www.google.co.uk";
p.Start();

And for opening a file path use:

p = new Process();
p.StartInfo.FileName = "explorer.exe";
p.StartInfo.Arguments = "z:\\directory\\";
p.Start();

Or to just execute a custom application on your network paths:

p = new Process();
p.StartInfo.FileName = "z:\\yourapp.exe";
p.Start();

HTH.
 
G

Guest

Once I have done the build, is there a way the user could change the links
manually, and the text on the button?

Maybe with some sort of password protection.

ex - user right clicks on button, selects properties and only allow him/her
to change the 2 items?

Thanks,
 
L

Leon Mayne [MVP]

BigBass1 said:
Once I have done the build, is there a way the user could change the
links manually, and the text on the button?

Maybe with some sort of password protection.

ex - user right clicks on button, selects properties and only allow
him/her to change the 2 items?

Hmm, you'll have to add this functionality programatically yourself somehow.
You can access the text of the button in your code using the ButtonName.Text
attribute, e.g:

Button1.Text = "My Computer";
 
L

Leon Mayne [MVP]

BigBass1 said:
Yes, but I am asking about after I build the project

That's what I mean. You could have some kind of settings page that asked for
the text the user wanted on the button using a textbox and then set the
button text to the value they enter:

Button1.Text = TextBox1.Text;
 
Joined
Oct 18, 2005
Messages
1
Reaction score
0
Passing commands to external application

Hi,
Is it possible to pass commands to some external applications from dotnet?
For example I'm starting some setup.exe and it shows a screen which has got a text box and a command button. I need to fill the text box with some text and click the command button to proceed the setup.exe further.
I would really appreciate your help.

Thanks in advance
-Lee
 
G

Guest

I am not an expert in code. But I have been trying to get this to work. I
have exhausted all resources in my powers. Could someone please help me with
the code I would need to write to edit properties of the button control after
I have built the program?

I would like for the user to right click on the control and a message box
appear with 2 text boxes. 1 for the button's attributes, and 1 for the
Button's text. When they have clicked "apply" button on message box, the
button's properties have been saved.

I am listing an example that I have so I will know where to input new code.

Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button23.Click
Pro1 = New Process()
Pro1.StartInfo.FileName = "iexplore.exe"
Pro1.StartInfo.Arguments = "http://www.microsoft.com"
Pro1.Start()
End Sub

Thanks for all help in advance

BigBass1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top