|
if you have access to the owner of the box (didnt set the owner paramter to null) then you might be able to loop through the children of that from to see if there is one, might not work and there is probably an easier way but i cant remember what it was right now. hope this helped some. I'm pretty sure there is a property somewhere that will tell you, mabye in Application or Environment...but i'm notsure anymore.
|
|
|
|
|
Thats for the reply. But the solution didn't work I also checked both Environment and Application class but no success
|
|
|
|
|
Hi,
if your question is in-process (is any of my forms showing a modal dialog?), then yes.
Start with your form, recursively enumerate all its children; if one is a form
check its Modal property.
[Correction: Sorry, this is wrong. dialog launched by a form is not part of
its Controls collection.]
[Addition: I don't know the answer to your question. Maybe you can narrow it
down; and just maybe you can solve it with the Form.ActiveForm and Form.Modal
properties; if not, I am afraid you will need to add code to set/reset a bool
every time you call/return Form.ShowDialog(). ]
-- modified at 8:11 Monday 30th July, 2007
-- modified at 8:27 Monday 30th July, 2007
|
|
|
|
|
///
/// enable/desable the using of binary file corresponding to the management mode
///
/// <param name="mode" />management state
public void EnableDisableUsingBinaryFile(string mode)
{
StringBuilder iniFilePath = GetIniFileName();
if (File.Exists(iniFilePath.ToString()))
NativeMethods.WritePrivateProfileString("EXCHANGE", "usebinaryfile", mode, iniFilePath.ToString());
}
this is my method, and after i analyze it with Fxcop i will have this error:
EnableDisableUsingBinaryFile(
String):Void' appears to have no upstream public or
protected callers."
how to fix this error???
thanks regards
dghdfghdfghdfghdgh
|
|
|
|
|
Hi,
I'm unfamiliar with FxCop, i.e. I know what it is but I have never used it.
Isnt the message you're getting an informational one, rather than an error;
sounds to me it just is saying that making your method private (rather than public
or protected) would be sufficient, since no one outside your class seems to be calling it.
|
|
|
|
|
Luc Pattyn wrote: Isnt the message you're getting an informational one, rather than an error;
sounds to me it just is saying that making your method private (rather than public
or protected) would be sufficient, since no one outside your class seems to be calling it.
Yes, all of the messages from FxCop are, ultimately, suggestions. It is up to the individual developer to decide if they are important enough to be fixed. This particular one falls in the category of maintainability.
|
|
|
|
|
Basically, this is telling you that (as far as FxCop can determine) the EnableDisableUsingBinaryFile method is declared but is never called (used) in the application. That is what is meant by "upstream public or protected callers".
If you are actually using this method, it may be called from a private or internal method, which FxCop won't "see". There are two ways to "fix" the error:
1. Actually make use of the method in your application or remove it if it's not needed.
2. Add a code supression attribute to supress that particular warning for that specific method.
The important thing to realize with FxCop is that everything is, ultimately, a suggestion. You aren't forced to correct them, although if you're taking the time to run FxCop you probably want to correct them.
|
|
|
|
|
Hi Guys and Gals.
Have any of you tried to read and write from Excel in .NET 2005? I have done that in .NET 2003, but the same functionality does not seem to work in 2005. Does anyone know where I can get information on this please?
Regards,
Elizma
|
|
|
|
|
public void GenerateBOMdata(BOMExportCollection bomexports, string filename)
{
TextWriter csvwriter = null;
try
{
StringBuilder bomdata = new StringBuilder();
// START: NAME: Sopan Take DATE: 20-09-2006 REASON: BUG Fix (ID: 0040788)
csvwriter = new StreamWriter(filename, false, Encoding.Default);
// csvwriter = new StreamWriter(filename, false, Encoding.GetEncoding(Thread.CurrentThread.CurrentCulture.TextInfo.ANSICodePage));
// START: NAME: Sopan Take DATE: 18-10-2006 REASON: BUG Fix (ID: 0043356)
// Headers
AppendTextToStringBuilder(bomdata, resourceManager.GetString("PLCExport.Quantity"));
bomdata.Append(osCulture.TextInfo.ListSeparator);
AppendTextToStringBuilder(bomdata, resourceManager.GetString("PLCExport.PartNumber"));
bomdata.Append(osCulture.TextInfo.ListSeparator);
AppendTextToStringBuilder(bomdata, resourceManager.GetString("PLCExport.Description"));
bomdata.Append(osCulture.TextInfo.ListSeparator);
AppendTextToStringBuilder(bomdata,resourceManager.GetString("PLCExport.UserNote"));
bomdata.Append(Environment.NewLine);
// Add data
foreach(BOMExport bomexport in bomexports)
{
AppendTextToStringBuilder(bomdata, bomexport.Quantity);
bomdata.Append(osCulture.TextInfo.ListSeparator);
AppendTextToStringBuilder(bomdata, bomexport.PartNumber);
bomdata.Append(osCulture.TextInfo.ListSeparator);
AppendTextToStringBuilder(bomdata, bomexport.Description);
bomdata.Append(osCulture.TextInfo.ListSeparator);
// END
AppendTextToStringBuilder(bomdata, bomexport.UserNote);
bomdata.Append(Environment.NewLine);
}
// END
csvwriter.WriteLine(bomdata.ToString());
}
catch
{
throw;
}
finally
{
if(csvwriter!=null)
{
csvwriter.Flush();
csvwriter.Close();
}
}
}
i have copied my code only.plz if something not clear plz feel to reply me ok bye
dghdfghdfghdfghdgh
|
|
|
|
|
Elizma wrote: Have any of you tried to read and write from Excel in .NET 2005?
You mean VS 2005? .NET on VS 2005 is only .NET 2.0.
Yes, I have read/write all the time from VS 2005.
Elizma wrote: Does anyone know where I can get information on this please?
Have you referenced the Office Interop in your projects?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Can anybody tell me how to call the click event or cellclick event of datagrid from a button click event or from any other function. And please let me know what are the parameters that have to be passed call that event. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
If you look at the event handler...let say the CellMouseClick event of a DataGridView object, it looks like any other method, but with a Handles keyword....like this:
Private Sub dgvMyGrid_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dgvMyGrid.CellMouseClick
So if you want to call the CellMouseClick event in your code anywhere else, you can call it just like you would any other method. You just need to send the proper parameters. In this case you have to pass an object and a System.Windows.Forms.DataGridViewCellMouseEventArgs object. If you don't reference either of these inside the CellMouseClick event, you could just pass nothing, like this:
dgvMyGrid_CellMouseClick(Nothing, Nothing)
This applies to all event handlers, not just Click events.
Hope this helps.
|
|
|
|
|
Sir, I can send the object but please tell me how to send the DataGridViewCellMouseEventArgs, like it contains many properties in it so please tell me how to assign those things, please. It will help me greatly.
Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Hi,
I have given it as u said (below)
DataGridViewCellEventArgs e1 = new DataGridViewCellEventArgs(1,1);
dgvLasers.CellClick(dgvLasers, e1);
but still its giving error as below
Error 13 The event 'System.Windows.Forms.DataGridView.CellClick' can only appear on the left hand side of += or -= C:\Documents and Settings\Administrator\Desktop\LCS\usrGauge\ManageLasers.cs 464 27 usrGauge
Please help me in this regard. Thank you.
Aleem
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Did you read the advice you were given ? Did you read the error message ? You were advised to create a click event, and to call it ( the method you create ), NOT the delegate on the control.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Good evening Christ
u r here thank god, please help me. I want to call a cellclick event of datagridview from my button click event. Could u please help me dear. I would be thankfull to you.
Regards,
Aleem.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
What you need to do, is call your own code, the method that you hook up to be called when the button is clicked. That's what was explained to you. You can't raise the click event, at least, not according to what I find with google.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Christ
No thats not my requirement is, my requirement is Letus assume we have a button called "Button1"
This buttons click event can be performed when I call "Button1.PerformClick();". k. I want the same thing to be happened when datagridview's cell is clicked.
Now what I need is I want to do is to either to execute the datagridview's cellclick event to be called explicitly as mentioned above with "Button1"
or
other wise calling the same internal method which is executed when a cell is clicked. Means this will be like event driven and delegate system so if I know the method which is called at the time of cellclick, I can call it by sending the proper parameters to it. Could u please help me Christ please. Thank you.
Regards,
Aleem,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Again, I've done some research for you, and I've seen many people say that you can't do this.
Why do you need to ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Christ as I told u earlier I need it for my client pls. help me yaar.
After selecting a particular cell in datagrid(it is done automtically when a button is clicked), but he needs to click the cell or datagridview once again to select the text in the cell.
What he needs is, it it also has to be done automatically when that button click is done in one shot. Can u please help me in this regard. please dont think that am bluffing u please. Thank you.
Regards,
Aleem,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: Christ as I told u earlier I need it for my client pls. help me yaar.
OK - my client wants money to come out of the floppy drive on their PC. You help me with that, and I'll help you with your impossible requests.
Christian Graus - Microsoft MVP - C++
"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 all,
I have a Windows application developped using C#.Net with .Net 2005. I have used a datagridview in it. That datagridview is allowing its contents to be changed or its cells are editable. When a button is clicked, a cell in the gridview is selected. This is how happeneing till now.
My clients requirement is, when that button is clicked apart from the cell is being selected, cursor must also be placed on the text of the cell, for user friendlyness. Pls. help me I will be thankfull to you.
The code that I am using to select a cell in the gridview is below :
dgvLasers.EditingPanel.Visible = true;
bEdit = true;
dgvLasers.SelectionMode = DataGridViewSelectionMode.CellSelect;
dgvLasers.Rows[intIndex].Cells[1].Selected = true;
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
You know, because we tell you every time, don't cross post. Pick a forum and stick with it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Again started the old rivelry, yaar please answer me yaar. If its not urgent y would I ask you for several times. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
If it's urgent why are you asking on a website where people give help for free? If you need it quickly and for a client then go pay for it.
|
|
|
|