|
Thanks guys, the
foreach (Control c in tp.Controls) was what I needed.
|
|
|
|
|
hi all,
can an object created for abstract class and interface?
can i use a static method in abstract class?
if i am using all methobs in abstract class as abstract method then how it vary from interface.why cannot i use an interface instead.
ganesh
|
|
|
|
|
Interface is like a contract that defines the structure of a class.
if a class implement that interfac it would have to do all that it singed at the "contract"
thungs that can be defirnd in an interface :
Methods
Indexers
Events
no :
Data members
Static
Constructor / destructor
no private / public before methods
have a nice day
p.s:
if we did not had abstact/interface
things would go and messy as they where
kobkob
|
|
|
|
|
kobibi wrote: Static
I really dont like it. I have a plenty of classes implementing ICorrector interface, which have not any fields - they are expected to have a static method which would validate some user's input. But instead I have to create an instance of a class to call this validate method
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Ganesh RV wrote: can i use a static method in abstract class?
Yes
Ganesh RV wrote: if i am using all methobs in abstract class as abstract method then how it vary from interface
It doesn't, except that the abstract class can define the method(s) as protected.
Ganesh RV wrote: why cannot i use an interface instead
You can, except with the interface you don't define an access modifier (public/private/internal/protected)
|
|
|
|
|
Please post your question in one place only. I answered this in the VB forum, are you using VB or C# ? I know the answer is the same, but it's rude to cross post.
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 )
|
|
|
|
|
Ganesh RV wrote: if i am using all methobs in abstract class as abstract method then how it vary from interface.why cannot i use an interface instead.
You can.
One big difference between interface and abstract class is that once you publish interface, you can't change it. When you publish abstract class, you can add members in next version without breaking anything. That's not possible with interface.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
hi
How to split or divide a single word document into multiple word documents using c#.
Note: i have Microsoft word 2000.
Nitin Raj Bidkikar
|
|
|
|
|
You could probably do some kind of Office Interop trick by creating individual files by reading in the original file...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Why it is so diffcuilt to set an set an environmet variable in C# ?
I have one program from Microsoft KB 829145 which set it but if you come out of process then it again reset. so from My computer-->Properties-->Advanced-->Environment variable-->System variables i never can see that updated value .
Sample from Microsoft site http://support.microsoft.com/kb/829145
did it but it dose not retains once you out of the process.
i did lot of search and found many are using WMI, registry functions but why microsost made it so diffcuilt to set it?
Why System.environmet class SetEnvuironmentVariable method not working ?
Is any simple program which will update the system environmet variable and retain the same value after process exits ?
Go to My computer-->Properties-->Advanced-->Environment variable-->System variables and there i must able to see the new updatred value.
|
|
|
|
|
void Environment.SetEnvironmentVariable(string, string, EnvironmentVariableTarget.User);
or
void Environment.SetEnvironmentVariable(string, string, EnvironmentVariableTarget.Machine);
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Hi
I already tried this but at dos prompt or from properties window of My computer ,if i type/view echo %MySysVariable% then it shows me an old value, not the new updated .
|
|
|
|
|
Setting an environment variable from code like this will not affect the overall operating system environment. It only sets the environment variable for the currently running processes environment, so the environment variable will not be visible in another command prompt window.
|
|
|
|
|
Yes, i agree with you .
Here some other testing application is reading a environment variable
and decides its excution so if MyEnvVar = 1 then launch some other process like that . so i need to store a return code of this process somewhere across the process so that any other program can read what value has been set by this program .
-sandeep
|
|
|
|
|
If the test program is launching your application, the easiest way would be to have your application return an exit code when it closes. The test program would then read that exit value.
|
|
|
|
|
Because setting an environment variable only affects THAT PROCESS. It will NOT update the system-wide table of environment variables.
When any process is launched, that process gets a COPY of the environment variables table that launched the process.
So, Windows Explorer (the Shell) has the master copy of the running environment variables. When you double-click an application to launch it, the loader gives the new process a copy of Explorer's environment table. When the code in that process modifies the environment variables, it's modifying it's own copy of them, NOT THE MASTER COPY IN EXPLORER!!
When the new process is closed, all changes to that copy of the environment table are lost.
The master copy of the environment variables are stored in the registry under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
But, changing those values will not take effect in any already running process. Only new processes launched by the Shell will get the updated variables.
|
|
|
|
|
Thank you very much , i totally underatand now.
Once you change the command shell , value of env variable changes .
-sandeep
|
|
|
|
|
Ok, here is some code (i cut some out so this message would not be too long) that I found that is for VB.NET for converting a PDF to a TIFF image.(it's at the very bottom, and how the heck do you do code(or even quote?) boxes on these forums???)
I'm trying to convert this code to C#. I've looked over the Acrobat Javascript API documentation and found that if I change "com.adobe.acrobat.tiff" to "com.adobe.acrobat.html-3-20" it will save as HTML, rather than TIFF. (which is my goal)
So, i've got Visual Studio Express for C# going and i've loaded my Acrobat reference, but i'm stuck on the javascript bridge part. For some reason Adobe thought it would be awesome to make a "Save As.." function only available with Javascript, so to do it on .NET one must create a javascript bridge.
What can I do to make this javascript bridge work?? here is the code I have so far for C#.. see the comment
I have searched and searched but found no "reference" for "JSObj". Can anyone provide any help at all with this?
My C# code..
CAcroPDDoc pdDoc;
CAcroAVDoc avDoc;
string test = @"C:\temp\test.htm";
pdDoc = (CAcroPDDoc)avDoc.GetPDDoc();
object JSObj = pdDoc.GetJSObject();
JSObj.SaveAs(test, "com.adobe.acrobat.html-3-20");
VB Code I found..
PDFApp = CreateObject("AcroExch.App")
PDDoc = CreateObject("AcroExch.PDDoc")
PDDoc.Open(Me.txtPDFPath.Text)
AVDoc = PDDoc.OpenAVDoc("TempPDF")
PDFApp.Hide()
JSObj = PDDoc.GetJSObject()
JSObj.GetField("Text2.0.0.0.0").value = "JESSICA"
strPDFText = JSObj.GetField("Text2.0.0.2.0").value
JSObj.SaveAs("C:\TestTiffs\TestGood.tif", "com.adobe.acrobat.tiff")
-Shea
-- modified at 6:27 Thursday 11th October, 2007
|
|
|
|
|
Don't know about your code, but as for code boxes, for small bits of code (a few lines) use the code tag:
<code>my code here</code>
For longer peices of code, with indentation, use the pre tags:
<pre>my long code</pre>
The pre tags preserve the indentation. You can also specify the langauge within your pre tags to have colorzation:
<pre lang="C#"> my c# code </pre>
|
|
|
|
|
shea851 wrote: JSObj.SaveAs(test, "com.adobe.acrobat.html-3-20");
try
object[] objArray2 = new object[] { _outputFile, "com.adobe.acrobat.html" };
jSObject.GetType().InvokeMember("SaveAs", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance, null, jSObject, objArray2);
"America prays for god to destroy our enemies. Our enemies pray for god to destroy us. Somebody’s gonna be disappointed!"
-George Carlin
|
|
|
|
|
Now i have a problem to search pdl(group) in the ldap server, i can search the pdl(group) with the following filter
string filter = "(&(objectClass=group)(displayname=" + displayname + "))"
but can only filter out with the whole display name
if i want to search with partial name, what should i do??
|
|
|
|
|
I'm facing one problem with DataGridViewRow.Tag. I set some values to DataGridViewRow.Tag. Then, I get those values whenever it is necessary. but when I do sorting the GridView by clicking the header of Girdview, all values which was set are gone...
The following is my sample code..
Filling the data to DataView
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
this.employeesTableAdapter.Fill (this.employeeMgmtDataSet.Employees);<br />
<br />
}
Setting the value to DataGridViewRow.Tag
private void button1_Click(object sender, EventArgs e)<br />
{<br />
<br />
foreach ( DataGridViewRow dr in dataGridView1.Rows )<br />
{<br />
dr.Tag = "Michael Sync";<br />
}<br />
}
Getting the value from DataGridViewRow.Tag
private void button2_Click(object sender, EventArgs e)<br />
{<br />
foreach ( DataGridViewRow dr in dataGridView1.Rows )<br />
{<br />
Console.WriteLine (dr.Tag.ToString ());<br />
}<br />
}
it works fine before sorting.. but Tag become "null" after sorting.. Why is it happening like that?
Any idea would be appreciated. Thanks in advance..
|
|
|
|
|
The DataGridView is probably rebuilding the rows from the datasource when you sort. This means it's removing all the existing rows and adding new ones.
There should be a Tag property for the objects in this.employeeMgmtDataSet, which you could use.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi,
I like to have a menu, in which a click with the right mouse button on a ToolStripMenuItem opens a ContextMenuStrip. Has anybody made such stuff? If yes how to do this?
At the moment I use the MouseUp event of the ToolStripMenuItems for differentiating a click with the left mouse button from one with the right mouse button. At a click with the right mouse button I want to show a ContextMenuStrip, but anyway the position isn't okay and the main menu closes.
Greets
pkoeppe
|
|
|
|
|
Simple :
Use the ContexMenuStrip in the ToolStrip Propertie and change it from "None" to "ContexMenuStrip";
Have fun
kobkob
|
|
|
|