|
Hello Martin,
Thanx for the message. It was a great help. I managed to get this going but I have one question.
I followed the article and managed to pass only ONE variable between Parent and Childs. I am not sure if there is a way to pass more than one variable or I am missing something.
Thanx again for your help, mate.
Khoramdin
|
|
|
|
|
Hello,
I'm glad I could help!
Khoramdin wrote: I am not sure if there is a way to pass more than one variable or I am missing something
You could:
)work with more than one property
)use a struct
)use a class
)use a collection, like Hashtable or ArrayList or ...
All the best,
Martin
|
|
|
|
|
Look at the ShowDialog method of a form for opening a Modal Dialog
<br />
using (MyForm myForm = new MyForm())<br />
{<br />
myForm.ShowDialog();<br />
}<br />
...and overloading the form constructor and/or return to provide the data you want.
Rhys
ELYSIUM, n. An imaginary delightful country which the ancients foolishly believed to be inhabited by the spirits of the good. This ridiculous and mischievous fable was swept off the face of the earth by the early Christians -- may their souls be happy in Heaven!
Ambrose Bierce (1842 - 1914)
Behind every argument is someone's ignorance.
Louis D. Brandeis (1856 - 1941)
|
|
|
|
|
private void logout_Click(object sender, EventArgs e)
{
conn.Open();
string strQury = "";
strQury = "insert into dashboarddealerlogin (logoutdatetime) values '(" + DateTime.Now + ")'";
SqlCommand cm = new SqlCommand(strQury, conn);
int n = Convert.ToInt32(cm.ExecuteScalar());
}
I have written this code in form1.cs and i need to write it there only on 'logout_click'.
Now i want to use this 'int n' in a function in form2.cs of same project:
funEntrylogin(m, i, tb_id.Text, tb_pswd.Text, DateTime.Now,n);
but here it is giving error on 'n',if i write the above code, as 'n' is not declared in form2.cs.
How can i declare this 'int n' of form1 in form2?
How can i do this?
thanx.
nekshan.
-- modified at 1:57 Tuesday 20th February, 2007
|
|
|
|
|
'form1
' define this n globally on top of form1
Public n As Integer
' form2
' create objec to from1 in from2
Dim f1 As New Form1
' used like
string s = f1.n
'this declaration is vb convert it to c# ok.
|
|
|
|
|
In form1,i defined it like :
namespace WindowsApplication1
{
public partial class form1 : Form
{
public DateTime n;
SqlConnection conn = new SqlConnection("Data Source=PROGRAMER;Initial Catalog=....");
.....
}
In form2,i made object of form1:
System.Windows.Forms.Form form1_ = new form1();
string d = form1_.n;
-- BUT it is giving error on 'n' here, 'n' doesnot come on click of'.' after form1_
I have used it like this in form1:
private void button1_Click(object sender, EventArgs e)
{
conn.Open();
string strQury = "";
strQury = "insert into dashboarddealerlogin (logoutdatetime) values '(" + DateTime.Now + ")'";
SqlCommand cm = new SqlCommand(strQury, conn);
n = Convert.ToDateTime(cm.ExecuteScalar());
}
Is my global declaration of 'n' still not proper?
Thank You.
Nekshan.
-- modified at 2:51 Tuesday 20th February, 2007
|
|
|
|
|
Hi
Use Query string or you can put this varaible in the session and get it from the session on next page
<l>Thanks and Regards
Sandeep
|
|
|
|
|
session? i m doing windows programming.
can i use session in windows programming? i dont think so..
if can... how?
Thank You.
nekshan.
|
|
|
|
|
Sorry Boss
You should mension that
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Store the value in a hidden html field.
And user server.transfer to go to other form
and in form2 use the request object to get the value of hidden field from form1
Nana
|
|
|
|
|
i m doing windows programming.
|
|
|
|
|
ya wind prog code is sent u
|
|
|
|
|
Declare a var in Form1 and not in method.
public static int n;
set the value in form1's method.
Now in form2 access it as Form1.n u will get the value.
Nana
|
|
|
|
|
you can set the variable up as a public static property of some class. This isn't the best technique as it is very similar to having a global variable.
You could set a property on form2 or pass the value of n into form2 in its constructor, I would rather do one of these depending on how your application is coded.
Russell
|
|
|
|
|
hi,
how to open a new form when ever a user clicks on e.g(compile button).
The window should pop up at bottom of main window like error window.
pls help me
Thank you
With Regards
prasad
|
|
|
|
|
Use window.open on click on button.
in the method add feature to open it at bottom.
Nana
|
|
|
|
|
hi,
can u elabarate it pls
Thank you
|
|
|
|
|
hi Friends,
i tried to convert pdf file to word document. but it is not convert properly. some pdf files are converted but some files are not converted. Just empty word document file created.
In this i used the dll files, from the below link,
http://www.codeproject.com/cs/samples/pdf2text.asp
If anybody knows the result help me.
Thanks in advance.
With Regards,
Balashanmugam Gurusamy.
|
|
|
|
|
Hi all
Is it possible to call a public method of a window service from a window application...
As in case of web service we can call webservice method explicitly, is it possible in case of window service...
Actually i have to pass parameter to window service from a window application and service will process those parameters
Thanx
Atul Kumar
|
|
|
|
|
It would help if you made this question much more specific.
|
|
|
|
|
This article[^] might help you.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
ello Everybody,
Can someone help in finding solution for dataview filter
I know how to use dataview filter and I had been using dataview for my application for biding 5 gridview.
Every gridview is binded by dataview. And when I'm using filter by sending filter criteria using textbox, it is possible to send any kind of string to filter the dataview.
Now problem is when I send
string like
1) *text, it works fine
2) text*, it works fine
3) te*xt, it fails why this is so?
Can someone please help me in this regard
Solution on this will be appreciated
Regards
Balasaheb Kahat
Software Developer
Platform: Asp.net,vb.net,C#
Database: SQL Server 2000
|
|
|
|
|
I need a solution for the follwing problem:
Is there a way to make a form control visible while scrolling the form and eliminate the change in Location of the control. The control should be placed directly on the form iteself, no container controls should be used like panel.
Thanks in advance
chandra
|
|
|
|
|
There are many ways to do what I think you are wanting to do. The easiest is to build your stationary panel and scrolling panel separately. In other words, what you are saying to scroll of the form is actually scrolled within a separate panel, while your stationary control simply sits in an unscrolled panel.
It is not possible to do what you want to do if the stationary control is actually anchored to the scrolled region -- it *must* move with it then. So, to accomplish what you want, you must deploy some kind of separate containers.
If you want your scrolling region to move under and perhaps around either or both sides of the stationary control, another thing you can do is locate the stationary control in a floating window above your form.
Yet another thing you might be able to do is anchor your stationary control to the root surface of a composite class, displaying it *over* a scrolling region covering the whole custom control surface. This may be the easiest, most straightforward approach if the first suggestion isn't quite what you want to do.
|
|
|
|
|
Hi all,
Do we have Toggle Button Control in VS2005?
Please tell me how to work with ToggleButton
I need to use two buttons- if i select one the other should be desibled,vice versa.
Hope u got my question.-Just a sample Toggle Button.
Please help me.
pashi
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|