|
wat does this mean >> Type or namespace definition, or end-of-file expected
can someone advise me wat to do..
|
|
|
|
|
My first guess would be that you don't have your { and } braces paired up properly. One of them is probably missing somewhere.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I would like to display a Cursors.WaitCursor on a ListView control, so I tried:
listView.Cursor = Cursors.WaitCursor;
but it doesn't work at all, I see always the default cursor.I know its a known ug in .NET 1.0 and probably fixed in 1.1. But I need workaround for 1.0.
I would appreciate any help in this regard.
Live Life King Size
Alomgir Miah
|
|
|
|
|
Hi,
I also had the same problem.I think it is not working with list views!
Have a nice day!
|
|
|
|
|
hi everyone;
my problem:
I have a userControl
in this usercontrol, I have a child control (a button)
when the mouse moves over the userControl, I can detect the movement using
MouseMove event.
the problem is when the mouse is on the child control : I can t detect
anything when the mouse move. userControl don t recieve the MouseMove event.
I did many search on this problem, but solutions I found are not elegant:
1- using hooks (not a part of .net platform)
2- the child control report the mouse movement to the parent control (the
userControl here)
please, can u explain me how to solve this problem?
thnks
n.b.: sorry for my english
|
|
|
|
|
derive a Class from Button ;
override MouseEvent in derived class !
d
|
|
|
|
|
mmmm, yes,
after overriding the MouseEvent, I do what?
|
|
|
|
|
I would like to save the state of some objects to disk. I do not want to use .NET Serialization classes. I want to write my own.
Can I pass the name of a class into a method and use it to cast an expression? This would allow me to write sort of a generalized "serialization method" to change any property variable to a String, write it to a file, read it from the file, and re-initialize the original property.
Thanks!
Mark
|
|
|
|
|
Reflection will probably allow you to do this. A better way would be to use C# 2.0 and write a templated class.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hey guys,
I was wondering if anyone knows of a way to plug into the IE login form to be able to tell if the Cancel button is pressed. Right now, I'm just using the DocumentError event to tell if I should refresh or just cancel. Unfortunately, the event for cancelling the action is the same as the Access denied error.
Anyone have any thoughts? Is there any way to plug into the IE login events?
Thanks,
-Dave
|
|
|
|
|
Here's the deal, I have a peer to peer connection where one side pushes across a web address to the other side. Now both applications navigate to this URL and display its contents. I would like to capture any navigation errors that occur...namely if the page cannot be found. Instead of displaying the standard 404 'Page Cannot Be Found' error I'd like to insert my own page, something along the lines of 'Content Server Cannot Be Found'. Now I know there's a NavigationError event that can be thrown, but not sure how to use it...here's a code snippet that I'm working from.
private void item_DoubleClick(object sender, System.EventArgs e)<br />
{<br />
Node selNode = this.item.SelectedNode;<br />
if (selNode != null)<br />
{<br />
<br />
Tag tag = (Tag)selNode.Tag;<br />
if (tag.type == TYPE.FILE)<br />
{ <br />
string url = tag.url;<br />
<br />
if (url != "")<br />
{<br />
Shell shell = (Shell)this.ParentForm;<br />
Object nobj=null;<br />
string urlval=url;<br />
<br />
shell.WB.Navigate(url,ref nobj,ref nobj,ref nobj,ref nobj);<br />
if (shell.RTC!=null)<br />
{<br />
shell.RTC.SendMsg("URL:" + urlval);<br />
}<br />
}<br />
}<br />
}<br />
}
Any an all help at capturing the navigation timeout error would be greatly appreciated! Thanks again
~rcurrie
|
|
|
|
|
The NavigateError event will be raised whenever the browser has some sort of error. If you timeout, the event will be raised and the messagebox will say your "Content server cannot be found" error.
Hopefully that'll help!
-llamaindustries
|
|
|
|
|
Sorry, simple solution...the implimentation escaped me. :P Here's the updated version...
private void item_DoubleClick(object sender, System.EventArgs e)<br />
{<br />
Node selNode = this.item.SelectedNode;<br />
if (selNode != null)<br />
{<br />
<br />
Tag tag = (Tag)selNode.Tag;<br />
if (tag.type == TYPE.FILE)<br />
{<br />
string url = tag.url;<br />
<br />
if (url != "")<br />
{<br />
Shell shell = (Shell)this.ParentForm;<br />
<br />
shell.WB.NavigateError += new AxSHDocVw.DWebBrowserEvents2_NavigateErrorEventHandler(WB_NavigateError);<br />
<br />
Object nobj=null;<br />
string urlval=url;<br />
<br />
shell.WB.Navigate(url,ref nobj,ref nobj,ref nobj,ref nobj);<br />
if (shell.RTC!=null)<br />
{<br />
shell.RTC.SendMsg("URL:" + urlval);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
private void WB_NavigateError(object sender, AxSHDocVw.DWebBrowserEvents2_NavigateErrorEvent e)<br />
{<br />
Console.WriteLine("CANNOT NAVIGATE");<br />
}<br />
~rcurrie
|
|
|
|
|
Does anybody know a regex expression to find every 3rd comma in a string? In other words I need a regex to find every nth character in a string.
/\ |_ E X E GG
|
|
|
|
|
Sure, you need to consume two commas before grouping a match on the third.
[^,]*,[^,]*,[^,]*(,) does it. It finds anything that's not a comma, the grabs the comma, three times. The third time is caught in a group.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This seems to be working but, not exactly how I need. Firstly thank you. Secondly, can you make it so it dosn't do that grouping thing. I'm using "Expresso Code Project Edition" a free regex utility on code project. Now if I put your expression in and run it against the string Day,Amount,Direction,3,100,West,5,43,North,5,44,NorthWest,7,54,South,2,5995,East,,,,,,,,,,54,35345,,,543,North,6,,West It does some weird grouping thing and when I hit the replace button with ";" as the replacment string, results don't come out right. Can you please take a look at when I'm saying by trying it in Expresso.
I want the string after replace to look like this
Day,Amount,Direction;3,100,West;5,43,North;5,44,NorthWest;7,54,South;2,5995,East;,,;,,;,,;,,,;,54,;35345,;,;,;543,North;6,,West (I got lazy, every 3rd comma should be a ";")
/\ |_ E X E GG
|
|
|
|
|
OK, you want to match this:
([^,]*,[^,]*,[^,]*),
This groups everything but the third comma, and just consumes the third comma. Replace it with this
$1;
This means grab the first group ( which is everything but the third comma ), and put a ; after it. This works in Expresso.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This works great. There is supposed to be a space between the "NorthWest" and so I put one in and your expession still works properly. Thanks.
/\ |_ E X E GG
|
|
|
|
|
One more quick regex question. Do you think it would be possible to do a regex on this string
| Day | Amount | Direction | 3 | 100 | West | 5 | 43 | North | 5 | 44 | North West | 7 | 54 | South | 2 | 5995 | East | | | | | | | | | | 54 | 35345 | | | 543 | North | 6 | | West
and turn it into this string?
Day,Amount,Direction;3,100,West;5,43,North;5,44,North West;7,54,South;2,5995,East;,,;,,;,,;54,35345,;,543,North;6,,West
So, bascially the same thing you did on the other string, except with |'s with 1 space on each side...
If you don't want to actually work out the regex for this on that's fine (but I wouldn't mind!), but could you tell me if it's a good candidate for a regex?
/\ |_ E X E GG
|
|
|
|
|
Definately a good candidate. Something like ([^|])|([^|])|([^|])| changing to $1, $2, $3;
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hey all,
I'm trying to set a beep(or any other non-threating noise) to sound when the users selects a node.
I've already used
[DllImport("kernel32.dll")]<br />
private static extern bool Beep(int freq, int dur);
but it doesn't make the sound i want, and since it is based on the kernel it has that rickety bios sound to it,
so anyways is there any way to get use of the windows sound schema like you could in vb, I've found the use of Microsoft.VisualBasic.Beep() but C# doesn't like the .Beep() stating that it isn't part of the Microsoft namespace, import am i missing? could i just as well use Microsoft.CSharp.Beep(); ? btw, I get the same namespace error...
Any better ideas?
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
I think you have to use MessageBeep from User32.
I copied this from the Microsoft.VisualBasic namespace:
Public Shared Sub Beep()
Try
New UIPermission(UIPermissionWindow.SafeSubWindows).Demand
Catch exception1 As Exception
Try
New UIPermission(UIPermissionWindow.SafeTopLevelWindows).Demand
Catch exception2 As Exception
Return
End Try
End Try
UnsafeNativeMethods.MessageBeep(0)
End Sub
<DllImport("user32", CharSet:=CharSet.Unicode)> _
Friend Shared Function MessageBeep(ByVal uType As Integer) As Integer
End Function
'You can make different sounds my passing one of these to uType:
Public Const MB_ICONASTERISK As Integer = 64
Public Const MB_ICONEXCLAMATION As Integer = 48
Public Const MB_ICONHAND As Integer = 16
Public Const MB_ICONQUESTION As Integer = 32
Public Const MB_OK As Integer = 0 'Default
Sorry i can't make C# of it, i'm a wreck at that...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
I have tried to use a Session Variable and a string that is going to be the body of a outlook email. I want to product line spaces in the body of the email. I have used the \n but it is not causing a new line, it is just adding a space.
Wanted to know if there is a way to cause a new line in outlook. My code is below:
string comment = "NEW INFORMATION " + txtComment.Text + "\n" + "\n" + "LOG INFORMATION " + txtLog.Text;
Thank You
Scott Moore
|
|
|
|
|
What is the format of the email? If it is html, then use <br> or <p>.
Matt Gerrans
|
|
|
|
|