|
dear;
how can i make my next button run my next windows application form.
thank you
ahmad al-omar
|
|
|
|
|
The best way is to write your forms as user controls and switch between them, if you want a wizard type interface. I think .NET 2.0 has a wizard control you can use, also. Otherwise, you just get an event handler for the button, and show the new form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Ahmad,
you can use an object of the form to show.
Create a new button in the first form. Label it as next.
double click the button. In the sub section that appears, place the following code.
//I am assuming that the second form name is Form2. Use accordingly.
Form2 fm2 = new Form2(); <br />
fm2.Show();
this.Hide();
I hope this helps
Keshav Kamat
India
|
|
|
|
|
thank you
i tried it and it works good .
ahmad al-omar
|
|
|
|
|
Search for Pizza Hut here in the forum to find an article dealing with that "although it deals with it in a tricky way"
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I need to link or call a exe file(form) if i click the button.How is thw method or coding.Please help me i'm in thouble now.TQ very much
private void button1_Click(object sender, EventArgs e)
{
???????
}
The exe file name is connection....Tq
|
|
|
|
|
You're looking for the Process[^] class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I need to change a Cell Value in a DataGridView which gets its data from DataBase, the problem is the type of the data I need to change is int16 in SQL and I need to change it in the dataview to string example:
if (this.dataGridView1.Rows[0].Cells[1].Value.ToString() == "0")/// its type is int16
{
/////////////////////// I need to change it from 0 to "Exist"
this.dataGridView1.Rows[1].Cells[2].Value = Int16.Parse("Exists", null);/// throw an exception
this.dataGridView1.Rows[0].Cells[2].Value =5 ; /// this works as I give it int , but this is not what I need :S
}
Thanks,
Nena
|
|
|
|
|
DataGridView just displays information, am I right? Can't you just directly edit the Value of a cell?
|
|
|
|
|
Hi Sean,
my main problem is that the column I need to edit its value is Short in the DataBase.
Therefore each type I pass string to this Column an Expection is throw Input is not in the correct form, That's way i was trying to convert string to int16 but still I can't do it.
This is so annoying to me , I don't want to change the field in the DataBase all I need is to change the Display instead of "0" to a string "Exists".
Hope i made it clear this time.
Thanks a lot
Nena
Egypt
|
|
|
|
|
Hi nena,
I hope this helps.
string Value;
string Exists="Exists";
Value= Datagrid1.Rows[1].Cells[1].Value.ToString();
if (Value=="0")
Datagrid1.Rows[1].Cells[1].Value = Exists;
be careful of the cell that you are working on. But it should work.
You can use a for loop for the rows and the columns. If you are searching in both rows and and columns for the value 0 then use something like this.
string Value;
string Exists="Exists";
for(int i=0; i<LoggerDatagrid.Columns.Count; i++)
{
for(int j=0;j<LoggerDatagrid.Rows.Count;j++)
{
Value= Datagrid1.Rows[j].Cells[i].Value.ToString();
if (Value=="0")
Datagrid1.Rows[j].Cells[i].Value = Exists;
}
}
hope it works.
Keshav Kamat
India
|
|
|
|
|
Hi Keshav,
This works only if the original data given to the DataGrid was string , my main problem is that the column I need to edit its value is Short in the DataBase.
Therefore each type I pass string to this Column an Expection is throw Input is not in the correct form, That's way i was trying to convert string to int16 but still I can't do it.
This is so annoying to me , I don't want to change the field in the DataBase all I need is to change the Display instead of "0" to a string "Exists".
Hope i made it clear this time. Waiting for your help
Thanks a lot
Nena
Egypt
|
|
|
|
|
I can't really shake a solution out of my sleeve, but I know a workaround that I often use.
Somewhere in your application you are probably using a Stored Procedure, or a SQL Query.
SELECT * FROM table
you could change it to this
<br />
(SELECT [Name], 'Exists' <br />
FROM [Table]<br />
WHERE [Field] = 0)<br />
<br />
UNION<br />
<br />
(SELECT [Name], [Field]<br />
FROM [Table]<br />
WHERE [Field] <> 0)<br />
Another option would be to add a new column to your dgv, and place it in place of the other one, and populate it with the desired values.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Int16 Value;
string Exists="Exists";
for(int i=0; i<LoggerDatagrid.Columns.Count; i++)
{
for(int j=0;j<LoggerDatagrid.Rows.Count;j++)
{
Value= (Int16)Datagrid1.Rows[j].Cells[i].Value.ToString();
if (Value=='0')
Datagrid1.Rows[j].Cells[i].Value = Exists;
}
}
please check if this works.
Keshav Kamat
India
|
|
|
|
|
Hello !
Can You tell me, what add-ins are you using, and what they do ?
Add-in's to Visual studio 2005
-- modified at 2:50 Wednesday 21st March, 2007
One nation - underground
|
|
|
|
|
Add-In's to what?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
What OS are you using? What type of hardware are you using?
Phil
|
|
|
|
|
If Windows XP, open a CMD prompt and type:
C:\WINDOWS>sc query type= driver
Make sure you put in the space between type= and driver .
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am using windows XP, but i want to get list of drivers using c#. Can you tell me some functions or methods?
One nation - underground
|
|
|
|
|
|
Sorry! I thought we were in the O/S Forum...:->
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi, have a look at ServiceController.GetDevices()
|
|
|
|
|
Thank you, very much!!!
One nation - underground
|
|
|
|
|
Good day to everyOne !!!
Can AnyOne tell me:
- in what format should i keep words in the dictionaries?
- how to keep the vocabluaries, how to make read/write ?
One nation - underground!
|
|
|
|