|
|
Hi,
Kindly help me, and let me know that, how may I call button_click event from another form? situation is that, both forms are opened.
Thank you in advance
(Riaz)
|
|
|
|
|
Why you are trying to do that ? You need to use delegates for communication between forms. Calling a button_click event from another form is not a good idea.
|
|
|
|
|
Adding to what Navaneeth said ( and he's 100% right ), if you have code that runs in a button click and needs to run at other times, you should factor it out into a method which can be called from the click, and via a delegate.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
The answers above are the correct way of doing it. A different 'quick' way is pass either the class containing the button_click method or the button istelf to the other form (in the constructor).
If using the first, make sure the button_click method is public and you'll be able to call it from your second form (you can use this, EventArgs.Empty for the parameters).
If using the second, simply call the button's PerformClick method.
If possible, use the other suggestions above though as they are a better way.
Dave
|
|
|
|
|
Hi!
Iam having data in dataset now i want to print that data in formatted design means with heading and some design.
kirankumar
|
|
|
|
|
What have you tried ? Are you displaying the data on a form, or just printing it ? What did google tell you ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
just iwant to see Preview and print.
kirankumar
|
|
|
|
|
Fine, but as Christian said, what format? What have you done?
|
|
|
|
|
I fill in datagridview and printed the datagridview it working fine but i have 100rows then it was not printing it is taking only one page for printing and i want to give heading for that page and some styles.
kirankumar
|
|
|
|
|
Hi
string[] s = System.IO.Directory.GetFiles(Server.MapPath("slide"));
here i am getting all the files in slide folder . but i want only the image files. i am having all types of image files in that folder (.bmp,gif,jpg) . how to get only the image files
|
|
|
|
|
md_azy wrote: (.bmp,gif,jpg)
Those ARE all image files. :P
You're going to have to iterate over the files and make a list of just files with image extensions.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Use the overload of Directory.GetFiles() as given here[^]
There's probably a way to select multiple extensions, but I can't figure out at the moment. You can always call it with different extensions, though.
Cheers,
Vikram.
Zeppelin's law: In any Soapbox discussion involving Stan Shannon, the probability of the term "leftist" or "Marxist" appearing approaches 1 monotonically.
Harris' addendum: I think you meant "monotonously".
Martin's second addendum: Jeffersonian... I think that should at least get a mention.
|
|
|
|
|
Hi all,
I would like to know whether there is a way I can validate the authentication the user has enter in a logon form (domain, username, password) with the windows authentication?
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
|
i m having a mdi form which displays a main form on its load containing a datagridview with users detail...and a add form on click of its toolstrip which adds new users record...i want to refresh my main form datagridview when a new record is added....i did
void AddNewRecord_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
{
MDIDiary.Main mn = new Main();
mn.loadPage();
}
this but it is not refreshing please help...loadpage() is a function which displays the users record on datagridview(bind the datagridview)...please someone help
|
|
|
|
|
Use this.owner.loadpage()
or this.parent.loadpage()
Best Regards,
Chetan Patel
|
|
|
|
|
but loadPage() is not a function of this parent...its a function of Main form..which is displayed on load event of the mdi form...so please help
|
|
|
|
|
Hi All,
Im right now working in Window Application using C#.
Is there any way to include another windows Application(written in VC++ having UI also) in my Application.
With Regards
Amjath
|
|
|
|
|
Maybe through a dll, not too sure...
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
How do you mean, include ? You can include anythign as a resource, but what do you want to do with it ?
Christian Graus - Microsoft MVP - C++
"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 First of all thanks for u response.
i have a Application written in vc++ window based(its some what black box to me).
i want to use that application in my c# window based application is it possible.
with Regards
Amjath
|
|
|
|
|
OK, that's SO not what you asked.
No, you can't really do this in a way that would be sturdy enough to release. You could make it work, by embedding the second exe inside the first but
a - they would run independant of each other and
b - it wouldn't be guarenteed to be stable
Christian Graus - Microsoft MVP - C++
"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'm finding it hard to find an example of a switch statement i'm trying which I think may mean I'm being stupid with it.
I have two string, string1 & string 2 which I want to compare and return a single result.
Like
switch(string1, string2)
case string1 == string2
return string1
case string1 != string2
return string2
default
return string3
Should I be using if ...else ... if else?
Cheers,
Jammer
Going where everyone here has gone before!
|
|
|
|