|
Thanks ashuka
you mean changing the
frmMain fM = new frmMain();
to
Form2 fr2 = (Form2)this.Parent; ?
menuItem1 is already public.
-::maximus::-
|
|
|
|
|
yeah dear
Ashu
Ashish Kasama
|
|
|
|
|
Hmmm...
Im getting this error:
An unhandled exception of type 'System.InvalidCastException' occurred
Additional information: Specified cast is not valid.
my code on the MDIChild form looks like this now
private void frmSignOn_Load(object sender, System.EventArgs e)
{
frmMain fM = (frmMain)this.Parent;
fM.menuItem1.Enabled = false;
}
-::maximus::-
|
|
|
|
|
where you launch it
frmSignOn frm = new frmSignOn();
frm. MdiParent = this;
frm.Show();
and at the time of
private void frmSignOn_Load(object sender, System.EventArgs e)
{
frmMain fM = (frmMain)this.MdiParent;
fM.menuItem1.Enabled = false;
}
|
|
|
|
|
Thanks much! it really worked!
got what went wrong
private void frmSignOn_Load(object sender, System.EventArgs e)
{
frmMain fM = (frmMain)this.Parent;
frmMain fM = (frmMain)this.MdiParent;
fM.menuItem1.Enabled = false;
}
Thanks Ashu
Regards
-::maximus::-
|
|
|
|
|
you are welcome
|
|
|
|
|
hello ,
i want to export data from datagrid to excel sheet iam getting one error,
error:
Control 'DataGrid1__ctl3__ctl0' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server.
iam getting error at this line
DataGrid1.RenderControl(htmlWrite);
please give me any advice
srinivas
|
|
|
|
|
Hi,
Hope this code help
private void button1_Click(object sender, System.EventArgs e)
{
SaveFileDialog SD= new SaveFileDialog();
SD.Filter = "csv|*.csv|Comma Seperated Files|*.csv|All Files|*.*";
SD.InitialDirectory = @"C:\";
if (SD.ShowDialog() == DialogResult.OK)
{
using (System.IO.StreamWriter writer = new System.IO.StreamWriter(SD.FileName))
{
int Colcnt = dsResults.Tables["tbl_Master_Pol_Lst"].Columns.Count;
int Rowcnt = dsResults.Tables ["tbl_Master_Pol_Lst"].Rows.Count;
for(int x=0;x<=(Colcnt-1);x++)
{
writer.Write(dsResults.Tables["tbl_Master_Pol_Lst"].Columns[x].ColumnName.Trim()+ ",");
}
writer.WriteLine();
for(int x=0;x<=(Rowcnt-1);x++)
{
for(int y=0;y<=(Colcnt-1);y++)
{
if (y == 2)
{
writer.Write("'" + dsResults.Tables["tbl_Master_Pol_Lst"].Rows[x].ItemArray.GetValue(y)+ ",");
}
else
{
String varData = Convert.ToString(dsResults.Tables["tbl_Master_Pol_Lst"].Rows[x].ItemArray.GetValue(y));
writer.Write(varData.Replace(","," ")+ ",");
}
}
writer.WriteLine();
}
writer.Flush();
MessageBox.Show(SD.FileName + " successfully created");
}
}
-::maximus::-
|
|
|
|
|
Thankyou zenithmaximus,
iam getting at savedialoguebox(SD)
iam using datagrid and also iam using paging for datagrid.
srinivas
|
|
|
|
|
Thankyou zenithmaximus,
iam getting at savedialoguebox(SD) <- you mean getting confused?
iam using datagrid and also iam using paging for datagrid.
the save dialogue statements is where you specify the path of where you're saving the data from your datagrid to a CSV file. The code applies to a scenario where you're saving your exported data from datagrid to a CSV(excel like) file, from clicking a botton.
-::maximus::-
|
|
|
|
|
iam getting error near save dialogue box C:\Inetpub\wwwroot\UserManagement\userdetails1.aspx.cs(170): The type or namespace name 'SaveFileDialog' could not be found (are you missing a using directive or an assembly reference?)
srinivas
|
|
|
|
|
Hi All,
I am new to C#. I have created a Windows Application and included a User Control in it. Now i want to use the User Control in my Form at Design Time. What is the procedure?
Thanks in advance.
|
|
|
|
|
Hello,
After you compiled it, you should see the UserControls in the Toolbox but not in the Standard Forms Controls.
There is a seperate region for your controls.
All the best,
Martin
|
|
|
|
|
I am unable to locate it. Could you help me out.
|
|
|
|
|
DumbDude.Dll wrote: I am unable to locate it.
Do you mean the Toolbox?
Ctrl+Alt+X
All the best,
Martin
|
|
|
|
|
I am sorry. I am unable to find User Control on Toolbox.
|
|
|
|
|
If you see your From in the design view (not in code view), and you look at the Toolbox in the Region UserControls.
If this is empty you can rightmouseclick at the toolbox and select "Add/Remove elements".
Then you search for your "exe" file under ..\bin\debug and doubleclick it .
The List should then contain your controls.
All the best,
Martin
|
|
|
|
|
Thank you very much Martin.
It works.
Thanks once again.
|
|
|
|
|
You are very much wellcome!
P.S.: There is a VisualStudio Forum[^] here on CP, for questions like this.
All the best,
Martin
|
|
|
|
|
Hello friends,
I want to turn off AGC (Automatic Gain Control) in WinXP and
Windows Vista also. How to do that.
Thanks in Advance.
Rahul Kulkarni
|
|
|
|
|
This automatic gain control[^]? What does it have to do with XP or Vista?
Anyway, this forum is for C# programming questions. You'll probably get better answers if you post your question in a more appropiate forum (probably outside CodeProject).
[EDIT: ok, I see how it is related to Windows. But how to do it programatically, I have no idea]
-- modified at 1:02 Thursday 26th July, 2007
|
|
|
|
|
Turning off the AGC cant be that hard in XP;
http://www.google.com/search?hl=en&rlz=1B2GGGL_en___AU221&q=turn+off+AGC+Windows+XP&btnG=Search
|
|
|
|
|
Thanks for REPLY.
But my friend i want to turn off AGC control through coding in C# only.
Not mannually. Thats why i asked this in C# forum only.
Rahul Kulkarni
|
|
|
|
|
you should have said so to begin with.
|
|
|
|
|
Hi,
I want to access Outlook Express programatically using C# in my Windows Application?
How can I do that?
Any Idea??????
Thanking you in advance
Jaz
|
|
|
|