|
I agree. And I suggest to put button click logic in a seperate function.
In form1:
private void button1_Click(object sender, EventArgs e) {
ShowMessage();
}
protected virtual void ShowMessage() {
MessageBox.Show("this is form1");
}
In form2:
protected override void ShowMessage() {
System.Windows.Forms.MessageBox.Show("this is form2");
base.ShowMessage();
}
|
|
|
|
|
erm..that what i was thinking too...thanks everyone here
|
|
|
|
|
Hi All,
I have a scenario where i need to create a setup for the windows application.I have created the msi for the application. During installation i am getting the port number and server name from the user. I need to update the resource file with in the above mentioned windows applcaition while installing with the values given by the user. I have no idea of updating the windows application dll while the install process is in action.
Can any one help me in this regard.
Thanks in advance
Cheers
Mani.
|
|
|
|
|
Hi, I don't think you can update the DLL during install. You'd be better off writing the server details to the registry or a config file in the application data folder, then adjusting your code to look for these details in that location. If you're concerned about the security of these details, you can easily encrypt them using the classes in System.Security.Cryptography.
Good luck!
Rob
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
I too thought of doing the same. But our client has mentioned pariculayly to save it in resourdce files. Anyhow i ll procceed with this idea.
Cheers
Mani.
|
|
|
|
|
How can I show vertical dividers in a StatusStrip control?
|
|
|
|
|
Put a label and then set the border property to right or left and set DisplayStyle to None
led mike
|
|
|
|
|
SWEET! Not exactly what i wanted but nice. It would be nice to have the ones that the toolstrip uses.
|
|
|
|
|
Hi
I want to do an MultiScan Application using WIA2.0 in C# .
ie)Using AutoFeeder i want to scan
I got an sample code from this link...
http://www.eggheadcafe.com/community/aspnet/2/76650/heres-some-sample-code.aspx
But scanner is not ending the process ......
It is not working properly when you feed more papers on the feeder......
But it is working fine for scanning single image....
I am Using xerox 510 scanner for scanning.
Any ideas for Multiscanning through WIA...Help me.........
Thanks in Advance
|
|
|
|
|
hello,
I am new to C#.net. I am developing Windows Application. I want to create a setup .It contains database backup. If I install the setup in target machine the database automatically restore in Target machine.
Could you please give any sample codes
please anyone Help me
|
|
|
|
|
I always write my own code to run SQL scripts to restore a database. I don't know how you can integrate that into an MSI.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
I am having a simple problem which is causing me to halt the project. anyways i want to declare a public string variable in a class. This variable is assigned a value from another class. The variable should be such that it can accept on a list of defined values.
Eg. declaring a variable such that it can only be assigned "test", "test2" or "test3". (on Vb.NET platform)
any help would be appreciated.
|
|
|
|
|
Expose a property and throw an exception if the value is not what you're expecting.
|
|
|
|
|
Use an enum, that is precisely what they are for.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thnx.. this is exaclty what i am looking for.
|
|
|
|
|
Hi everyone. I'm new to programing and i have a question.
I have a winforms mdi application. Let's say my parent form is form1. From form1 a call a child (form2) and i want to use a DataTable from form1 in form2. Ok i'ved made a reference to form1 in form2. But my question is: I have a form3 being called from form2 and in that form3 want to update data in the DataTable from form1. How can i make this?
Thanks in advance.
|
|
|
|
|
You should use properties, events and that kind of stuff for that.
|
|
|
|
|
You might want to read this[^] little article.
|
|
|
|
|
Ice_LS00 wrote: Ok i'ved made a reference to form1 in form2
Don't ever do that. Use delegates.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you guys. Delegates..... How did i never tought on that....
You just rocked my world
But i still have a doubt. I have read the article about the delegates and found it very useful, but it doesn't solves my problem.
I have a frmMain that calls a child. That childs calls a new child and in that second child i need to update the main. Like this (frmMain - calls - frmChild1 - calls - frmChild2 - updates - frmMain).
Does any one know how to resolve this?
Thanks in advance.
modified on Tuesday, April 15, 2008 7:03 AM
|
|
|
|
|
Hi
Will it be possible to open an excel worksheet in a MdiParent form and still keep the excel functionality? Specifically graphs and pivot tables.
|
|
|
|
|
how to create si/psi editor for Digital Video broadcasting (DVB) using C#.net Language
|
|
|
|
|
One line at a time, I guess.
Any work on video in C# probably involved DirectX, I would think. But, perhaps what you want is more specialised and would require a third party library.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi there,
my windows operating system encountered the following error:
user Init.exe-unable to locate component
it prevents me to open my computer at all , after I log on it the error shows up and then the halt on desktop screen .
it could be because of bad installation.
any suggestions ?
and there is a command to be typed in the run to fix and repair the system files from a windows cd, dose someone know what it is?
I appreciate your help
Thanks in advance
There is always something to learn
|
|
|
|
|
Hi,
I am trying to make a webpage with a link. When users click on this link, it launches a webbrowser on my server, do some stuff and return information.
Right now, I have successfully made my code for creating the webbrowser and processing data. But I cant seem to run it from an aspx webpage. It throws the exception :
ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.
So now, I m simply trying to instanciate the webbrowser from the webpage and this still crashes as well.
I would really appreciate any help you could give me.
Here is the code that I ve got on my webpage for the link:
<br />
<form id="form1" runat="server"><br />
<div><br />
<asp:linkbutton id="launchBro" text="Launch the Bro" runat="server"><br />
OnClick="broMethod"></asp:linkbutton><br />
<br /><br />
<br /><br />
<br />
</div></form>
When clicked, the link launches this method in this class:
<br />
<br />
using System.Windows.Forms;<br />
using mshtml;<br />
<br />
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
<br />
}<br />
<br />
[STAThread]<br />
public void broMethod ( Object s, EventArgs e)<br />
{<br />
<br />
WebBrowser mybro = new WebBrowser();<br />
<br />
<br />
}<br />
<br />
}<br />
<br />
I also tryed to simply copy my class creating the webbrowser which is working into this project and instantiate it from this method, but it doesnt work either.
Thx,
Mathieu
|
|
|
|