|
kensai wrote:
Hi. Let's say you saw a code like this:
Qwe.Asd.Zxc;
As far as I know this Zxc could be:
1. Name of a nested class
2. Property
3. Static member/function
AFAIK:
This is not a valid C# syntax. The problem is on ';'
If you have the following:
Qwe.Asd.Zxc
Then it could be (1) and (2), a field, a type specification (for casting), or a const, and (3) and a non-static method in the context of a delegate instatiation.
If you have the following:
Qwe.Asd.Zxc(
Then it could only be (3).
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|
|
Daniel Turini wrote:
Qwe.Asd.Zxc
Then it could be (1) and (2), a field,
BZZZZ! Or a static member! (iow 3) <edit> oops too drunk to follow whole sentence <edit>
PS: or it could just be an alias, or a delegate.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
It can technically be anything. It all depends on what Qwe and Asd are. But it could be anything from a Namespace to a field.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Hi!
I want to know how much I have scrolled when I pull the scroll bar in a listview. Is there anyway to know scroll position of a listview?
|
|
|
|
|
Hi all
does anyone know if its possible to dynamically assign text to a label??
or if any other method could be used to dynamically display text on a form??
everything i've come across seems to use string literals!!
regards
Paul
Paul Griffin
|
|
|
|
|
Hope I have not misread what you are after, as what I think you are after is really easy
On you form you have a label called lblMessage that says "hello" and a button called butChange
add the method
private void butChange_Click(object sender, System.EventArgs e)
{
lblMessage.Text = "new text" ;
}
hope this helps and sorry if i missed the point
Reiss
|
|
|
|
|
When you have executed your applications code within the .NET IDE why is it that the properties window cannot be accessed until the code has been closed and re-opened within the IDE?
Has anyone come accross a solution to enable you to see the properties window again even after executing the code?
|
|
|
|
|
Hit F4 or go to View|Properties Window
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
David Stone wrote:
Hit F4 or go to View|Properties Window
No, this won't help. It's a very annoying bug on the VS.NET IDE, and MS recognized it on their top VS.NET bugs page, and only occurs when the Properties Window is at some specific positions.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|
|
That normally ends up with VS.NET running into some infinite loop, having to close it via the TaskManager.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
I want to refresh a treeview just by WinForm's handle,please help me.
my code is (in another class) :
.....
public void RefreshTreeView(IntPtr frmHandle)
{
Form Frm = (Form)Control.FromHandle(myHandle);
// it is wrong with this code in runtime
foreach(Control ctrl in Frm.Controls)
{
Type myType = ctrl.GetType();
...
}
}
.....
How can I do? Help !
kingdom
|
|
|
|
|
I am trying to deploy IDocHostUIHandler:GetExternal in a C# application. However all of the documentation I find is a C++ example to return the IDispatch handle to the caller. Would returning (this) actually handle this or is there something else I have to do ?
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
public void GetExternal([MarshalAs(UnmanagedType.IDispatch)]<br />
out object ppDispatch) {<br />
ppDispatch= (IYourInterface)this;<br />
}
regards,
Bog
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
|
Yes - check out the DLLImport attribute from System.Marshal
(Don't know the C# syntax I'm afraid but theres a VB example in my "Monitoring the printer in VB.Net" article)
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
if you want to check out all the win32 API for reference then check the following site,
http://www.codeproject.com/system/hooksys.asp
http://leb.net/wine/WinDoc/funcIndex-local.html
|
|
|
|
|
Michel, here's an example for you.
You can group the import specs as shown here, or interspersed through your code...
class Win32
{
[DllImport("kernel32.dll")]
public static extern bool Beep(int freq,
int duration);
[DllImport("kernel32.dll")]
public static extern void SleepEx(int imeinms,
int alert);
[DllImport("kernel32.dll")]
public static extern int WinExec(string pgmname,
int hideorshow);
[DllImport("kernel32.dll")]
public static extern void ExitProcess(uint
exitCode);
[DllImport("winmm.dll")]
public static extern bool PlaySound(string
pszSound, int hmod, uint fdwSound);
[DllImport("kernel32.dll")]
public static extern uint GetCurrentProcess();
[DllImport("kernel32.dll")]
public static extern bool TerminateProcess(uint
hndl, uint exitcode);
}
call the functions from your code (say the Beep function)
as:
Win32.Beep(freq,duration);
Hope this helps.
Spolia Opima
|
|
|
|
|
Tx exactly what I was looking for.
|
|
|
|
|
Look at this code...
==============================================================================
string strClaim = "BER";
Regex objNaturalPattern = new Regex("[Bb][Ee][Rr]|[Tt][Ww][Oo]|[Ss][Tt][Oo]");
objNaturalPattern.IsMatch(strClaim);
==============================================================================
ok the return value to "objNaturalPattern.IsMatch(strClaim);" will be true as it matches [Bb][Ee][Rr]. Now what I might want to do and it needn't only apply to this example is know which Regular expression ([Bb][Ee][Rr]|[Tt][Ww][Oo]|[Ss][Tt][Oo])the string matched.
Is there any possible way to get some kinda of return value to say which one was matched?
as in a string matching [Bb][Ee][Rr] would return 0
as in a string matching [Tt][Ww][Oo] would return 1
as in a string matching [Ss][Tt][Oo] would return 2
no match could return -1
Is this posible? Is there a method that I have over looked?
elp!
Thomas
|
|
|
|
|
I might not follow you, but if you want to get the string that was matched, you
objNaturalPatter.Match(strClaim).Groups[0].Value
Bog
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Is there such a thing in C#?
|
|
|
|
|
Michel Prévost wrote:
Is there such a thing in C#?
Not in .NET 1.0, but 1.1 includes a Directory browser dialog. (or whatever its called, don't have a copy in front of me)
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
Ohh...thats nice to know, of course now I will have to download and install it.
Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that?
- Jack Burton
|
|
|
|
|
Michel,
Using the .Net 1.1 SDK you can just use the
System.Windows.Forms.FolderBrowserDialog.
If you are using the 1.0 SDK you can inherit from
System.Windows.Forms.Design.FolderNameEditor.
This implementation will most likely require that you use a
FolderNameEditor.FolderBrowser.
I have a class already written that can do this job if you like.
Also, I think there is at least one implementation posted here on CP.
Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that?
- Jack Burton
|
|
|
|
|
if you aren't aware then check out
MSDN for .NET 1.1 which includes Browse Folder also.
and lots more
|
|
|
|