|
If you really mean what you say - modulus (as in remainder from division), see the post from laserbaronen (% is the modulus operator in C#). If you're doing scientific calculations and you want the IEEE specification of the remainder operation, use Math.IEEERemainder() instead.
If you mean the absolute value (as in |-1| = 1, which could be infered from your example), see the post from Shree (Math.Abs does that).
The precedence of the modulus operator (%) can be found in the C# reference (which shouldn't be further from you than the F1 key and a couple of mouse clicks). It's in the multiplicative operator group (same precedence as * and /).
--
Peter
|
|
|
|
|
Hi,
I made a user control. it is also a collection ( made by ) various user controls .
Eg : ButtonControl is made by various buttons.
I want to write the property of one of this control ( like EditButton it has contain ) at designer at design time in my application by using property window.
like this :::
this.ButtonControl .EditButton.Text = "Edit me"
how can I do ???
Plz help ...
|
|
|
|
|
In your usercontrol override OnPaint like this:
protected override void OnPaint(PaintEventArgs e)
{
if (this.DesignMode)
this.EditButton.Text = "I'm in design mode";
base.OnPaint(e);
}
or do the same but for the OnPaint in your window
|
|
|
|
|
Can anybody tell me how to pass value from Popup window to Parentwindow.
I've a parent.aspx page in which i have three textboxes with each have images for opening ImageSelector Popup window. When I click on the image then popup window open and when i choose image and then click on the save button then after i want to close the popup window and then the selected image name should be display in the textbox.
Note that I have three textbox.
1.txtSmallImage (Img1_ImageSelectorPopUp)
2.txtMediumImage (Img2_ImageSelectorPopUp)
3.txtLargeImage (Img3_ImageSelectorPopUp)
What i did when i click on the image1, image2, image3 then i opened the same popup window. Now i made a fucntion in a javascript name GetImageName(imageName). When i click on the save button then I call this function like that
this.btnSave.Attributes.Add("onclick","javascript:GetImageName('" + ImageName + "')");
the defination of function is here
function GetImageName(ImageName)
{
// ControlID can instead be passed as query string to the popup window
//window.opener.document.getElementById("ctl00_ContentPlaceHolder1_TextBox2").value = ImageName;
window.opener.document.getElementById("ctl00_MainContentPlaceHolder_txtprdTitleImage").value = ImageName;
window.close();
//window.opener.document.all("select1").options(window.opener.document.all("select1").selectedIndex).text=text1.value ;
}
Problem is that I dont understand that how can I access the parent page controls like txtSmallImage, txtMediumImage, txtLargeImage so that I can assigin the value to that controls's text property value.
Please help me or if you understand what i want to do then kindly provide me the complete solution means that when i click on the any imagePopup then value return on the specific txt(Small,large, medium)Image textbox.
Rgds,
Farhan,
Karachi, Pakistan.
|
|
|
|
|
This belongs to the ASP.NET forum.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Hi,
I want to set an image for TabPage Button. Is it possible?
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
I guess you can do this using DrawItem event of tabcontrol.
|
|
|
|
|
|
Can you show some code on how to do that?
|
|
|
|
|
Set an ImageList for the Tab control
Then opent the TabPage Collections->set Image Index for Each Page.
It's working.
Thanks
Sababathi B
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
Hi,
Am in a process of image conversion.I've found a class,ImageFormat which supports file formats such as tiff,bmp,png...But i need to convert DWG to .x(DirectX file format)..But both these formats(DWG,.X) are not supported by this ImageFormat class..Which class should i use.Please guide me.Thanks in Advance.
Regards,
Priya
|
|
|
|
|
You can try the following Dll from this link "http://www.cad2dtp.com/en/truedtp_dll.htm"
Another one way is:
Find out the .dll which one is used in autocad for "save" option.
Regards
Saba
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
This task is a little involved. If you want the conversion to be performed programmatically, you need to look for a free conversion routine. If it suffices to convert them manually, you can use 3D Studio MAX. I think it can open .DWG files, and there is a plugin at http://www.andytather.co.uk/Panda/directxmax_downloads.aspx[^] that will allow you to save them in .X format, though some details might be lost.
|
|
|
|
|
Hi everybody, I have a following problem.
My computer uses SQL Server 2000. I write my project on my local machine. I use Dataset to retrieve data from QLNS database. When I set up my project to other machine in LAN. I encounter this error while running exe file.
"An error has occured while establishing a connection to the server. When connecting to SQL Server 2000, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections (provider: Name Pipes Provider, error: 40 - Could not open a connection to SQL Server".
Please kindly teach me how to solve this. Thank you very much.
Hope your help.
It seem to be a solution or an answer.
|
|
|
|
|
Is this server accessiable from your system. Try telnetting to port 1433 to confirm the same.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
I have checked port 1433.It is available in Client Network Utility. Maybe some security policies cause the problem. I'm so confused ...
It seem to be a solution or an answer.
|
|
|
|
|
You may also check if the server has an inernal ip which may allow connections from your cllient network.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
1. I don't mean to be condescending, but are you sure you aren't connecting to localhost?
2. Are you able to connect to this database from Query Analyzer on the second machine?
3. Check your SQL Server settings.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
I am using IFilter in C# to get the value-type properties of a document by calling the
IFilter::GetChunk and IFilter::GetValue methods. I read the property name of well-known properties of
property sets whose GUID is {F29F85E0-4FF9-1068-AB91-08002B27B3D9} and
{D5CDD502-2E9C-101B-9397-08002B2CF9AE} by their respective property id.
But my query is how can I read property name of User defined properties (GUID =
{D5CDD505-2E9C-101B-9397-08002B2CF9AE}) by their respective property id.
So, would you kindly help to solve my problem?
Thank you.
|
|
|
|
|
WHat is the code of copy, paste
Sajkblbhgnyugfu
|
|
|
|
|
Copy: Ctrl + C
Paste: Ctrl + V
|
|
|
|
|
There's a clipboard class.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
I need to use Reflection to retrieve the properties of a given object. That's easy. The problem is that I don't know which object to use until run-time. The object is already available and I can't use Reflection to re-create it since its constructor is not available. Let me clarify with some code:
object obj = GetInstantiatedObject(objectName);
Type type = obj.GetType();
foreach (PropertyInfo property in type.GetProperties())
{
....
}
Does anyone know what object GetInstantiatedObject(string objectName) should contain?
Thanks in advance!
Al
- Is God willing to prevent evil, but not able? Then he is impotent.
- Is he able, but not willing? Then he is malevolent.
- Is he both able and willing? Whence then is evil?
- Is he neither able nor willing? Then why call him God?
Epicurus
|
|
|
|
|
Al Beback wrote: The object is already available and I can't use Reflection to re-create it since its constructor is not available.
I don't really understand that part - you already have an object, why not just use it?
|
|
|
|