473,508 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Button control question

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
Oct 8 '05 #1
6 1442
BigBass1 wrote:
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.
Oct 8 '05 #2
Works great!!!!

Thanks for the help!

Have a great day!

"Leon Mayne [MVP]" wrote:
BigBass1 wrote:
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.

Oct 8 '05 #3

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,

Oct 10 '05 #4
BigBass1 wrote:
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";
Oct 10 '05 #5
Yes, but I am asking about after I build the project

"Leon Mayne [MVP]" wrote:
BigBass1 wrote:
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";

Oct 12 '05 #6
BigBass1 wrote:
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;
Oct 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2426
by: Scott Schade | last post by:
I have a form onto which I add a control during execution. The control is a control that I wrote. The control has a number of controls on it. I would like to click on a button on the control and...
1
1573
by: Olav Tollefsen | last post by:
I have a rather fundamental ASP.NET question. On my page I have a search text box for user input, a button (which invokes a event handler on the page) and a user control to display the results....
3
2498
by: Jeremy | last post by:
I have an ASPX page with a bunch of System.Web.UI.WebControls.Button controls on it. By default, clicking on any of these causes a Postback. I'd like to have it so that for a couple of these...
7
2564
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
14
4945
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
1
6947
by: Jeff Lynch | last post by:
I'd like to add the following attributes to the Login control's Login Button to create a CSS rollover effect. How can I access the control's login button from the page's code-behind? ...
1
1495
by: tranky | last post by:
Hi boys.. ....i've a question for you! I've a custom control with a button. Well... I need to create that: <mytagprefix:mytag runat="server" onButtonClick="Button_Click"> And in the code...
1
3194
by: rn5a | last post by:
I want to create a custom control that encapsulates a Button & a TextBox. When the Button is clicked, the user is asked a question using JavaScript confirm (which shows 2 buttons - 'OK' &...
8
5835
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
I am working with Visual C# window and in my application I need to use a button ( NEXT) . The button should displays one panel with its objects each time it clicked. I already developed the codes...
19
4534
Frinavale
by: Frinavale | last post by:
I'm in the middle of implementing a custom Ajax enabled Server Control. At this point I need help finding the answer to an Ajax Framework question...here it goes: I have a Server Control that...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.