|
Hi,
On double clicking on the grid, the event invoked is:
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
End Sub
this gives RowIndex and ColumnIndex, whereas you will get e.location under the mouse click events, such as:
Private Sub DataGridView1_CellMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseDoubleClick
End Sub
Hope this helps.
Vinay
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
hi all,
i have a huge problim i have been asked to devolep a small project to log errors and exceptions on widows EventLog and i have no privalge on it can any body help me on this .
i tryed
<assimbly:eventlogprivalge(securityaction.assert)>
and it dosent worked!
thx
|
|
|
|
|
AFAIK you only need elevated permissions for creating a new log, not reading from or writing to an existing one.
MSDN[^]
Dave
|
|
|
|
|
Dave,
i know how to create and write event but the problem i dont have a privlage to do that ,
i tried too many ways the problem stills.
thanks for trying to help me
|
|
|
|
|
Hi
I want to write c# application that simulate web browsing. For example, searching something in google, and getting the page of the first result.
It should work automatically, i.e a console application and not a GUI.
For this purpose I should know how to do the following:
1. get a page (google.com)
2. fill a form (the search text box)
3. press a button (Google search button) and get the result page
4. click on a link (of the first result) and get the page
I guess that if I know what classes and methods are required I will be able to complete the rest.
Thanks!
Moti
|
|
|
|
|
Look at WebClient for a start.
|
|
|
|
|
Well, this just plain can't work . How can you browse the web from the console ? You can do a http post and get the html of the response, that is true. But, you talk about pressing a button - there are no buttons in console apps.
Try to come up with a spec that makes sense, first. Then look into how to do a http request and response in code.
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 )
|
|
|
|
|
HI, all, I want to ask a question as what I described in the topic.
For example, now I have some data in the text box, such like :
$VTG,,,,,,,,,N*30
$GGA,,,,,,0,00,99.99,,,,,,*48
$GSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GSV,1,1,00*79
$GLL,,,,,,V,N*64
$ZDA,,,,,00,00*48
$GSV,,,,,,,,,,00*67
.
.
.
.
.
From all these data, what I want is only the string starts with $GSV, so how can I pick this kind of string out and put them into another textbox?Should I save all these data first and use the [COLOR="Red"]StreamReader[/COLOR] to read each line of the saved file?
Thank you for your kind helping~!
|
|
|
|
|
A textbox has a Lines property. Use that.
|
|
|
|
|
asumming that all that is in a multiline text box you could try to use textBox.Split(); youll have to split it by the newLine character. the split method returns an array, you can then foreach the array and use if(myString.StartsWith(@"$GSV"))
hope it helps, good luck
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: you.suck = (you.passion != Programming)
Me like ....
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
thanks
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
I would use a regex, if you know how the string starts. Or even just the string search functions in the string 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 didnt see leppies post bofore i posted mine, use the textBox.Lines(as leppie said) property like this
string[] myArray = textBox1.Lines;
foreach (string myString in myArray)
{
if (myString.StartsWith(@"$GSV"))
{
MessageBox.Show("Found One");
}
}
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi, HarveySaayman, I found this code is very useful and I can get what I want with this code. Thank you very much.
Have a nice day~!
|
|
|
|
|
Hi, HatveySaayman, can you tell me why the code you put in the bracket is @"$GSV" but not "$GSV"? Is it because the string is begin with a '$'? Sorry to ask a question like this, I am a newbie in C#. Thank you for your kind helping.
|
|
|
|
|
hey
the @ infront means that the string in between the "'s are literals, if you dont have the @ infront and the user has for example a \r(return escape character)someware in the textbox this will be seen as a return character. where if the @ is infront it will be seen as "\r".
the @ basically ignores escape characters like \r or \n ect...
hope that makes sense
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: hope that makes sense
Not really, it's \ not / !
|
|
|
|
|
oops! my bad i fixed it
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
I would like to have a header/title on top of property Grid like a frame.
But I found only toolbarvisble option is available.
How to have a header on a property Grid ?
Thanks,
Rajan
|
|
|
|
|
Just wrap the grid and a label in a panel.
|
|
|
|
|
Hi all,
I am planing to have 2 panel, p1 and p2. Is possible the p1 content can scroll by p2's scrollbar(vertical or horizontal)?if yes,how can i make it?
any information or articles are welcome.Thanks
regards
cocoonwls
|
|
|
|
|
hey,
im not sure if this is directly posible, BUT you could use events to attempt it...
if there is an event like scrollBarMoved on p2 you could try to override it and send the args to p1 and then move its contents around as you wish.
these are simply ideas ment to get you thinking, i have no idea if this will work
good luck
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi,
thanks for your reply.I think i am miss up 1 question here.I am already add the Vscrollbar in my panel and set the max,min and smallvalue in the Vscrollbar.It display in my form but i can't scroll the content in the panel.Can you please give me a direction to make it?
thanks in advance
cocoonwls
|
|
|
|
|
heres what you need to do...
private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
int difference = e.NewValue - e.OldValue;
foreach (Control ctrl in myPanel.Controls)
{
if (ctrl.GetType() != typeof(VScrollBar))
{
ctrl.Location = new Point(ctrl.Location.X, (ctrl.Location.Y + difference));
}
}
}
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|