|
Fernando Jaspion wrote: if (c.GetType.ToString() == "System.Forms.CheckBox")
You don't want to do a string compare here. What you want is:
if (c.GetType() == typeof(System.Forms.CheckBox);
Ian
|
|
|
|
|
no no, just
if (c is CheckBox) ...
|
|
|
|
|
right you are!
Ian
|
|
|
|
|
Hello,
I mostely prefere to cast direct to the class I'm checking on, cause often a member of this class is on interest.
CheckBox cb = c as CheckBox;
if(cb!=null)
A recursive method would check the "Controls" property of the Control instance c.
RecursiveMethod(this.Controls);
private void RecursiveMethod(ControlsCollection cc)
{
if(cc!=null)
{
foreach(Control c in cc)
{
CheckBox cb = c as CheckBox;
if(cb!=null)
{
}
else
{
RecursiveMethod(c.Controls);
}
}
}
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
I want to use other name of class for example:
this is a simple class:
class Myclass
{
private int _No;
public Myclass()
{
}
public int No
{
get{return _No;}
}
}
I want to use other name a new name (Nocc) for Myclass
Nocc N1=new Nocc();
N1.No=91;
|
|
|
|
|
Your Myclass doesn't have another name. Where did this Nocc thing come from?
|
|
|
|
|
first thank you for reply
Nocc is the new name i want to use it Like Myclass
i do not know what's the command to do something like this
thanks in advance,
|
|
|
|
|
A class cannot have two names. To use the Nocc name all you'd have to do is replace MyClass with Nocc in the class definition.
|
|
|
|
|
class Nocc
{
#region Variables
private int _no;
#endregion
#region Constructors
public Nocc()
{
}
#endregion
#region Properties
public int No
{
get {return (_no);}
set {_no = value;}
}
#endregion
}
I have no idea what your asking for... I just like #regions
|
|
|
|
|
irishdunn wrote: I have no idea what your asking for
I think he means aliasis. Like String and string. System.Int32 and int
|
|
|
|
|
Giorgi Dalakishvili wrote: I think he means aliasis. Like String and string. System.Int32 and int
Oh then:
using Nocc = MyClass;
// then in code:
Nocc mything = new Nocc();
// etc
led mike
|
|
|
|
|
I am trying to bind a control to this dataset and have been successful thus far, problem is I want to be able to specify the row in the table the control is binding to. Apologize for any ineptitudes in advanced, very new to this.
sample:
newTBox.DataBindings.Add("Text", _Data, _tableName + "." + field, false);
I want to do something like this:
newTBox.DataBindings.Add("Text", _Data, _tableName + "[" + _rowNumber + "]" + "." + field, false);
right now it is always binding to the 0th row in my table.
Thanks in advance
|
|
|
|
|
Can U use a filtered select query or view instead of the table as data source?
|
|
|
|
|
No I am working with a supplied dataset, so I will have to navigate through it properly.
I am trying now to get something like this to work:
("Checked", Data.Tables[_tableName].Rows[_rowIndex], field, false);
don't think thats gonna hack it though
help!
|
|
|
|
|
Still cant figure this out
here is my poopy code:
newTBox.DataBindings.Add("Text", _Data.Tables[_tableName].Rows[_rowIndex],
_tableName + "." + field, false);
|
|
|
|
|
Use a DataView to filter your original dataset and bind the dataview to your controls.
SG
|
|
|
|
|
How do i use the rowfilter parameter in the dataview. I have an integer representation of the row I need but this requires some sort of name value pair. Is there a way i can directly use my integer?
|
|
|
|
|
Can anyone help to convert vb.net code to csharp
Transform XML using XSLT and get HTML code
' then create PDF document from produced HTML code
Set PDFDoc = CreateObject("PDFDocScout.PDFDocument")
PDFDoc.InitLibrary "demo", "demo"
PDFDoc.OutputFilename = "XML2HTML.pdf"
PDFDoc.AutoOpenGeneratedPDF = true
PDFDoc.BeginDocument
' load source XML document
Set xmlDocument = CreateObject("Msxml2.DOMDocument.4.0")
xmlDocument.async = false
xmlDocument.load("Simpsons.xml")
' load XSLT template
Set xslDocument = CreateObject("Msxml2.DOMDocument.4.0")
xslDocument.async = false
xslDocument.load("Simpsons.xsl")
' create XML doc to store result of transformation
Set objResultXML = CreateObject("Msxml2.DOMDocument.4.0")
objResultXML.async = false
objResultXML.validateOnParse = true
' transform XML using XSLT into objResultXML document
xmlDocument.transformNodeToObject xslDocument, objResultXML
' convert produced HTML code from objResultXML document into PDF
PDFDoc.Page.AddHTMLBox objResultXML.xml, 0,0, PDFDoc.Page.Width, PDFDoc.Page.Height, true
PDFDoc.EndDocument ' close PDF document generation
' disconnect from library
Set PDFDoc = Nothing
raj
|
|
|
|
|
CreateObject is not a VB.NET method I'm familiar with. Do you mean VB Script or JavaScript?
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: CreateObject is not a VB.NET method I'm familiar with
It's there as a static/shared method under the Microsoft.VisualBasic namespace. It creates instances of COM components by ProgID.
You CAN import the VB namespace in C# and use it from there. The object returned won't be strong-typed at all. If you wanted to call any of the methods or set properties, you'd have to do so through reflection. Doing your own late binding is NOT my idea of a good time!
A better method would be to set a reference to the component file in question and let the runtime create a RCW wrapper for you.
|
|
|
|
|
Is there any possible method to write code for this functionality?
Really its very urgent for me?
|
|
|
|
|
I just told you how to do it in the lower branch of this thread.
|
|
|
|
|
Dave Kreskowiak wrote: It's there as a static/shared method under the Microsoft.VisualBasic namespace
Thanks. Learning new things is good.
only two letters away from being an asset
|
|
|
|
|
i just need to write code in c#, is it possible to write java script?
|
|
|
|
|
raj510 wrote: just need to write code in c#, is it possible to write java script?
Nope. Java is entirely different runtime. The .NET CLR and the Java VM do not talk to each other at all.
Go to the Project Properties, then set a reference the PDFDocScount under the COM tab. After that, you'll be able to import the namespace ("using" statements at the top of your code) and create the objects just like any other .NET class.
|
|
|
|