|
I need tutorials or articles on "Ray Picking" in C#. Anyone of you have any ideas where i can learn from internet? I have download the example form GotDotNet but it is hard for me to understand. I try to search in google but most of the examples in C/C++.
thanks in advance.
|
|
|
|
|
How can I access to an enumeration defined in a class from an instance of another class which inherit from the first?
Example:
public class Parameter {
public enum Something {
...
}
}
public class MyParameter : Parameter {
...
}
MyParameter.Something doesn't work! I think I missed something
regards
|
|
|
|
|
Try base.Something
Hope it helps
|
|
|
|
|
Thank you but I would like to expose the enumeration to the client of the class. Maybe it is more a problem of scope.
For instance, to expose a private member of the base class, I would create a public property but I don't know how to do it for an enumeration.
|
|
|
|
|
public class A
{
protected SomeEnum e;
}
public class B : A
{
public SomeEnum E
{
get { return base.e; }
set { base.e = value; }
}
} You can't access private fields - not even in derivative classes. That's why they're declared as private.
Exposing an enumeration is like exposing any other type, be that a reference type or value type (which an enum is, along with primatives and structs).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Well, all is ok...
I am sorry but I missed that in fact my class was not inherited from the class which defined the enumeration but from an inner class of it . It was more a problem of scope than of code...
Thank you for your replies,
Best regards
|
|
|
|
|
Hello,
how can I get the URL from an open Internet Explorer? I tried it on this way:
InternetExplorerClass IE = new InternetExplorerClass();
txtGetURL.Text = IE.LocationURL;
But this returns allways an empty string
|
|
|
|
|
Your going to need to use SPY++ to get the handle of the IE's addressbar (which is a combobox). Then you will use the User32.dll SendMessage and WM_GETTEXT, which is documented here PINVOKE.net[^]
/\ |_ E X E GG
|
|
|
|
|
Hi Friends,
I need to cast a string to long. I'm reading information from an XML file. The file contains information such as record's ID, Age. These are declared as C# type long. I'm using System.XML.XMLDocument class for reading XML File. All the values returned by XMLDocument object are in string format. so i get ID ang Age as strings not Long. Now i need to cast them as long so i can utilized them safely in my program... I've searched MSDN and it says type casting across differnt domain is not allowed.
Is there any workaround to cope up with this situation ???
Thanks in advance,
Regards,
Hatim Ali.
|
|
|
|
|
Use an overload of Int64.Parse to convert your string.
|
|
|
|
|
|
Hi Guys,
How to validate a TIME?
- After selecting the data from the database SQL SERVER I need to validate the time. IF it's > 12:00 am then I will not accept that particular record no specific dates.
ex0. 2004/06/20 12:01:43 AM - this is not allowed
ex1. 2004/06/20 12:00:01 AM - this is not allowed
if I used this sql statement using the ex0 or ex1 value it gives me a "0" value
select datepart(hh,requestdate) from dtrequest where requestno='DRAFT104' group by requestdate
Anybody who can direct me to a page where I can read and give me idea or solution, or if you can help me.
Thanks
/Dabuskol
|
|
|
|
|
dabuskol wrote:
IF it's > 12:00 am then I will not accept that particular record no specific dates
Then what records are you accepting? 12AM == Midnight, 12PM == Noon
So, the result you are getting from the datepart is correct. Zero-hundred-hours == Midnight.
When dealing with dates and times I always use the 24-hour clock - it is much easier to work with.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
|
dabuskol wrote:
12 PM..
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
hello there,
i want to take lively images from a webcam which connects to my PC from USB.
if you help me i will be very very happy.
have nice work.....
turgaytr@hotmail.com
T.A
|
|
|
|
|
you'd better have the driver and SDK of the webcam.
then you can do it better.
|
|
|
|
|
|
:-Ohai there,
i have a form with controlbox in my application. If the user click on close button. then I want to show a message box(MessageBoxbuttons.YesNocancel). i wrote different operation to handle all this three choices. but the funny thing is no matter if i click yes or No or Cancel this will dispose the form.
i want to dispose the form if the user select Yes.
Other wise i need to keep the form active( If user choose cancel or no).
any idea
Please feel free to contact.
Sreejith S S Nair - Bangalore
|
|
|
|
|
sreejith ss nair wrote:
any idea
Yep, you need to override the OnClosing event and capture the DialogResult from your user. Based upon the users response, change the Cancel property of the CancelEventArgs and pass it to OnClosing of the base class. Here is a quick example:
protected override void OnClosing(CancelEventArgs e)
{
DialogResult r;
r = MessageBox.Show("Do you want to quit?", "Quiting",
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if(r == DialogResult.No)
e.Cancel = true;
base.OnClosing (e);
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
nice shoot dear
Please feel free to contact.
Sreejith S S Nair - Bangalore
|
|
|
|
|
I want to draw many strings in graphics, but I don't know how to get the size of the string in pixel (not the Length) to control them..
( As the function CSIZE GetTextExtent(CString) in Visual C++ )
Can you help me?
Cuoc doi ai biet dau ngay mai...
|
|
|
|
|
Minh Tong Tong wrote:
Can you help me?
Sure, if you read the MeasureString[^] method of the Graphics class, it returns a SizeF structure which gives you both the Height and Width of the string measured in pixels.
- Nick Parker My Blog | My Articles
|
|
|
|
|
does anyone have any straightforward method of clearing the console screen with an explanation?
i know it can be done...
|
|
|
|