Click here to Skip to main content
       

Windows Forms

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: Not able to call the procedure.membernitish_0716 Apr '12 - 8:28 
ya I have done this....bt nothing happened...same error shows....
 
ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.0.77-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add_emp(@fname, @lname, @bday)' at line 1
AnswerRe: Not able to call the procedure.mvpLuc Pattyn16 Apr '12 - 8:55 
I looked again at your code, and now I'm wondering maybe something is wrong about the bday type (DATETIME,DATE) and the DATE function; so I'd recommend you leave it out till you get the SP working, then add it back in and fix it if necessary.
 
Note 1: I also saw your first Con.Open() was commented...
Note 2: and you do check the SP for existence before creating one, but not the table itself.
 
Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: Not able to call the procedure.membernitish_0716 Apr '12 - 9:20 
I have deleted the bday option but again same issue.....and con.open() is not an issue....
 
and i have checked sp for its existence....no issue....
AnswerRe: Not able to call the procedure.memberMember 847381525 Apr '12 - 19:11 
i think as keyword missing.
First exexcute the block in sqlserver then try into fron tend.
But best practice is using sp
QuestionHow to create mysql stored function from c#.netmembernitish_0714 Apr '12 - 23:51 
I have to create mysql stored function from c#.net.
User will create the function at run time and i have to pass this string in odbc command like this...
 
rt.Text = "CREATE FUNCTION" +" "+ "`" + node + "`" +" "+ "." +" "+"'"+textBox1.Text +"'"+" "+"  ()"+" "+ "@RETURNS INT"+" @BEGIN@END;";
            rt.Text = rt.Text.Replace("@", System.Environment.NewLine);
OdbcCommand cmd = new OdbcCommand(rt.text, cn);
                                cmd.CommandText = rt1.text;
                                cmd.ExecuteNonQuery();
 
But it shows that You have syntax error.Check the manual that correspond to your mysql document...so plz tell me what is the problem.....??
AnswerRe: How to create mysql stored function from c#.netmemberEddy Vluggen15 Apr '12 - 0:30 
nitish_07 wrote:
But it shows that You have syntax error

If you encounter an error or an exception, than paste the entire thing into your post. I'm guessing that it's an exception that's thrown on ExecuteNonQuery as your Sql-statement is malformed. It's also damn hard to read.
 
Concatenating strings is fun, but you don't want to overdo it. The code below is allowed too;
rt.Text = "CREATE FUNCTION `" + node + "` . '"+textBox1.Text +"'   () "+ 
"@RETURNS INT @BEGIN@END;";
 
            rt.Text = rt.Text.Replace("@", System.Environment.NewLine);
 
OdbcCommand cmd = new OdbcCommand(rt.text, cn);
                                cmd.CommandText = rt1.text;
                                cmd.ExecuteNonQuery();
I'm going to guess again that it's the `-character that's not being recognized, and that it should be replace with a '. Further, you'd want a Debug.Print(rt.Text) so that you can easily validate the syntax of your query.
 
Hope this helps Smile | :)
Bastard Programmer from Hell Suspicious | :suss:

GeneralRe: How to create mysql stored function from c#.netmembernitish_0715 Apr '12 - 3:33 
Error is this
 
System.Data.Odbc.OdbcException: ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.0.77-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''df' ()
RETURNS INT
BEGIN
return 1;
END' at line 1
 
and string is i.e rt.text=
"CREATE FUNCTION `userdb` . 'df'   () \nRETURNS INT \nBEGIN\nreturn 1;\nEND;"

AnswerRe: How to create mysql stored function from c#.netmemberEddy Vluggen15 Apr '12 - 3:49 
I think the error goes away if you change the type of quote in there;
"CREATE FUNCTION 'userdb'.'df'() \nRETURNS INT \nBEGIN\nreturn 1;\nEND;"
Again, the character ` cannot be used instead of the character '.
Bastard Programmer from Hell Suspicious | :suss:

GeneralRe: How to create mysql stored function from c#.netmembernitish_0715 Apr '12 - 4:31 
ok I am trying...actually this is written in the orginal mysqlbrowser when i create the fucntion
 
CREATE FUNCTION `userdb`.`gh` () RETURNS INT
BEGIN
  return 1;
END$$
 
so i think this is also ` not ' ???
GeneralRe: How to create mysql stored function from c#.netmembernitish_0715 Apr '12 - 4:37 
Thanks man done....Smile | :)
AnswerRe: How to create mysql stored function from c#.netmvpDave Kreskowiak15 Apr '12 - 4:45 
First, using string concatentation to build a query is just plain bad practice. Especially when you are doing with with consecutive, individual characters. It makes your code impossible to read and debug accurately.
 
Oh, and your call to Replace is not needed at all. Using the @ character in a string to denote new lines in an SQL statement is a bad idea since SQL parameters usually start with that character.
 
A better method is to use String.Format:
    string queryString;
    queryString = String.Format("CREATE FUNCTION '{0}'.'{1}'()\nRETURNS INT\nBEGIN\nEND;", node, functionName);
Now is your code easier to read, or is mine?

GeneralRe: How to create mysql stored function from c#.netmembernitish_0715 Apr '12 - 4:58 
Yes you are right...Thanks man....If you could provide the solution for the problem which i posted some min ago....
QuestionSearch Box In Windows Form [modified]memberonurag1914 Apr '12 - 19:43 
Every one voted it down how can i remove it?
Ques was:- I am Trying to built the search box for my windows app that searches the data from the database
Thanks

modified 15 Apr '12 - 9:27.

AnswerRe: Search Box In Windows FormmvpRichard MacCutchan14 Apr '12 - 21:22 
You need to give some more detail about what this box will do and what part you are having trouble with. Putting your question into Google will give you some useful suggestions.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness

QuestionRe: Search Box In Windows Formmemberonurag1915 Apr '12 - 3:20 
Thanks For help
AnswerRe: Search Box In Windows FormmemberEddy Vluggen15 Apr '12 - 0:25 
onurag19 wrote:
I want to develop a search box for my windows form application please help..

You might want to elaborate a bit on your question. What's going to be searched? A database, the internet, the local filesystem?
 
If you're targetting a database, read up on the LIKE function.
Bastard Programmer from Hell Suspicious | :suss:

QuestionRe: Search Box In Windows Formmemberonurag1915 Apr '12 - 3:20 
Thanks that wat i was looking for thanks a lot
AnswerRe: Search Box In Windows FormmvpLuc Pattyn15 Apr '12 - 3:24 
Please don't remove original content, it ruins the whole thread as what remains is unintelligible.
 
Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

AnswerRe: Search Box In Windows FormmvpRichard MacCutchan15 Apr '12 - 3:50 
onurag19 wrote:
Ques was:- I am Trying to built the search box for my windows app that searches the data from the database

This is no more descriptive than your original question. Try asking a question with some specific detail; you have still not explained which part of this project is causing you difficulty.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness

GeneralRe: Search Box In Windows Formmemberonurag1915 Apr '12 - 3:53 
I am Trying to built the search box for my windows app that searches the data from the database like if admins types the keyword student the name of all the students should be shown. I have used the LIKE operator for it but its not working accurately.
GeneralRe: Search Box In Windows FormmvpRichard MacCutchan15 Apr '12 - 4:19 
onurag19 wrote:
but its not working accurately.

I don't think anyone can guess why from that little information. Try and explain clearly what you are doing, what results you expect, and what results you see. If some of your code is failing then show that code (not all, just the failing portion), and be sure to check and explain the values of any variables used.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness

GeneralRe: Search Box In Windows Formmemberonurag1915 Apr '12 - 3:55 
Thanks for you Interest Sir.
QuestionDatagridview cell not updating in Windows 2008 SP2 servermemberharvid12 Apr '12 - 2:00 
Hello,
 
I'm using a Datagridview in Windows application. Its working fine in my local machine, but when i tried to execute in my server( Winodws 2008 SP2), few columns not updating with the value using the below statement.
 
DataGridView1.Rows(e.RowIndex).Cells("ApprovedBy").Value = "UserName"
 
DataGridView1.Rows(e.RowIndex).Cells("ApprovedDateTime").Value = Now()
 
Can anyone suggest a solution for this.
 
Please!!.
 
Thanks
AnswerRe: Datagridview cell not updating in Windows 2008 SP2 serverprotectorPete O'Hanlon12 Apr '12 - 3:08 
What do you return from Now()? Is it a DateTime?

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Datagridview cell not updating in Windows 2008 SP2 servermemberharvid12 Apr '12 - 3:11 
Yes Pete. Its a DateTime column.
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 serverprotectorPete O'Hanlon12 Apr '12 - 3:13 
Could you show us the code in Now()? I suspect that this is where your problem is lying - the server using a different date format to your local version.
 
Of course, you could whack some exception handling and logging into your DAL and see what the server is rejecting.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Datagridview cell not updating in Windows 2008 SP2 servermemberharvid12 Apr '12 - 3:29 
DataGridView1.Item("ApprovedDateTime", e.RowIndex).Value = Now()
DataGridView1.Item("ApprovedBy", e.RowIndex).Value = Username
 
But the same code works fine for below columns
 
DataGridView1.Rows(e.RowIndex).Cells("LastModifiedBy").Value = Username
DataGridView1.Rows(e.RowIndex).Cells("LastModifiedDateTime").Value = Now()
 
I tried to mimic the Null reference error, by replacing the first two lines with the below lines
 
DataGridView1.Item("ApprovedDateTime", e.RowIndex).Value = now() DataGridView1.Item("ApprovedBy", e.RowIndex).Value = username
 
even now also, i'm experiencing same issue and Application got crashed.
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 serverprotectorPete O'Hanlon12 Apr '12 - 3:50 
What are the column definitions for those fields (both the Approved... and the LastModified... fields)? If you could show us your table definitions then we could have a look.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Datagridview cell not updating in Windows 2008 SP2 servermemberharvid12 Apr '12 - 4:03 
Hello Pete,
 
Pls find the details below.
 
ColumnName DataType Length Nullable
--------------------------------------------------------
ApprovedFlag int 4 no
ApprovedDateTime datetime 8 yes
ApprovedBy varchar 30 yes
LastModifiedBy varchar 30 yes
LastModifiedDateTime datetime 8 yes
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 serverprotectorPete O'Hanlon12 Apr '12 - 5:05 
Hmmm. Sorry, I can't see what's happening. What you could do, is attach the query explorer to the SQL Server instance, and see what SQL it's receiving. That would be what I would do.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Datagridview cell not updating in Windows 2008 SP2 servermemberharvid12 Apr '12 - 5:18 
Could you please let me know the steps to do this?
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 serverprotectorPete O'Hanlon12 Apr '12 - 5:51 
You can find out how to do this here[^].

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Datagridview cell not updating in Windows 2008 SP2 servermemberharvid12 Apr '12 - 21:38 
Hello Pete,
 
I tried to debug the code in the server after installing Visual studio.
 
I'm getting the below error in Cell_formatting event in this line
 
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Used"
e.CellStyle.BackColor = Color.LightGreen
e.CellStyle.SelectionBackColor = Color.LightGreen
e.CellStyle.SelectionForeColor = Color.Black
 
ERROR:
An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll
 
{Unable to evaluate expression.}
 
I have made a check below, but it is partly working and not updating "Status" column and coloring,
 
If e.Value Is Nothing Then
Exit Sub
End If
 

Is there anyway i can mimic this issue?
 
Please help. I can also paste my Cell_formating code if you want to look at it.
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 serverprotectorPete O'Hanlon12 Apr '12 - 22:10 
Wait a second. You're changing the value of some text here in this event? I'm pretty sure that will trigger the event again - this would lead to a StackOverflowException.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Datagridview cell not updating in Windows 2008 SP2 servermemberharvid12 Apr '12 - 23:17 
Please let me know if there are any steps to overcome it.?
 
I will need to set the Color for "status" column.
AnswerRe: Datagridview cell not updating in Windows 2008 SP2 servermvpLuc Pattyn13 Apr '12 - 1:58 
When an event is called SomethingChanged, you expect it to fire only when Something gets a value different from the current one. However in WinForms some of those events will also fire when assigning the same value as the property already had, and that is one way to get StackOverflowException. The easiest way around is by explicitly testing yourself, as in:
 
    ...
    if (Something!=theValueIWant) Something=theValueIWant;
    ...
}
 
And yes, those events carry the wrong name, should have been GotAssignedTo or something such.
 
Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: Datagridview cell not updating in Windows 2008 SP2 servermemberharvid13 Apr '12 - 3:05 
If dgEditor.Columns(e.ColumnIndex).Name = "Status" Then
If dgEditor.Rows(e.RowIndex).Cells("Status").Value = "NEW" Then
'if already marked as new, leave it alone
If IsDBNull(dgEditor.Rows(e.RowIndex).Cells("CommonLineName").Value) Then
Else
If dgEditor.Rows(e.RowIndex).Cells("CommonLineName").Value <> "" Then
e.CellStyle.SelectionForeColor = Color.DarkGreen
e.CellStyle.ForeColor = Color.DarkGreen
e.CellStyle.BackColor = Color.Orange
e.CellStyle.SelectionBackColor = Color.Orange
End If
End If
Else
If dgEditor.Rows(e.RowIndex).Cells("UsedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Used"
e.CellStyle.BackColor = Color.LightGreen
e.CellStyle.SelectionBackColor = Color.LightGreen
e.CellStyle.SelectionForeColor = Color.Black
Else
If dgEditor.Rows(e.RowIndex).Cells("ExpiredFlag").Value = 1 Then
If dgEditor.Rows(e.RowIndex).Cells("ApprovedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "UnUsed" 'approved expired
e.CellStyle.BackColor = Color.LightGray
e.CellStyle.SelectionBackColor = Color.LightGray
Else
If dgEditor.Rows(e.RowIndex).Cells("RejectedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Expired" 'Rejected expired
e.CellStyle.BackColor = Color.LightCoral
e.CellStyle.SelectionBackColor = Color.LightCoral
Else
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Expired" 'pure expired - never approved and never rejected
e.CellStyle.BackColor = Color.Gray
e.CellStyle.SelectionBackColor = Color.Gray
End If
End If
Else
If dgEditor.Rows(e.RowIndex).Cells("RejectedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Rejected"
e.CellStyle.BackColor = Color.Red
e.CellStyle.SelectionBackColor = Color.Red
Else
If dgEditor.Rows(e.RowIndex).Cells("ApprovedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Approved"
e.CellStyle.BackColor = Color.Green
e.CellStyle.SelectionBackColor = Color.Green
Else
If dgEditor.Rows(e.RowIndex).IsNewRow = True Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "NEW"
e.CellStyle.SelectionForeColor = Color.DarkGreen
e.CellStyle.ForeColor = Color.DarkGreen
e.CellStyle.BackColor = Color.HotPink
e.CellStyle.SelectionBackColor = Color.HotPink
Else
If dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Edited" Then
e.CellStyle.SelectionForeColor = Color.DarkGreen
e.CellStyle.ForeColor = Color.DarkGreen
e.CellStyle.BackColor = Color.HotPink
e.CellStyle.SelectionBackColor = Color.HotPink
Else
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Pending"
e.CellStyle.SelectionForeColor = Color.Black
e.CellStyle.BackColor = Color.Yellow
e.CellStyle.SelectionBackColor = Color.Yellow
End If
End If
End If
End If
End If
End If
End If
 
'Application.DoEvents()
End If
 

 
Above lines are in my Cell formatting event. I have commented out Application.DoEvents as it was causing some issue.
 
Could you please elaborate how i can proceed with
if (Something!=theValueIWant) Something=theValueIWant;
.That would be much helpful.
AnswerRe: Datagridview cell not updating in Windows 2008 SP2 servermvpLuc Pattyn13 Apr '12 - 3:57 
1.
Thank you for a bunch of code, unformatted code at that, where it is all about nested IFs and no visible indentation. There is no way to read and understand that as it stands. You should edit your message and apply PRE tags to the code.
 
2.
You should NOT be calling Application.DoEvents(). Not there, not anywhere. It is a very dangerous method, misunderstood by most everyone. If you think you need it, something is wrong with your code and adding it is bound to make things worse as it disturbs the natural flow of events. So remove it everywhere! And remove it completely, don't just turn it into a comment, as if there would still be some value left in it.
 
3.
If you are assigning new cell values in there, that will cause a new barrage of events being fired, which you probably don't want. You certainly don't want an avalanche of events (as a StackOverflow would result).
 
One way to handle it could be this:
 
Dim currentStatus as String = ...  ' save the content of status cell
Dim newStatus as String = currentStatus
...
' lots of conditional code, which does not change the status cell;
' if a new status is required, store it in newStatus.
...
If newStatus <> currentStatus
    ' now store the new status in its cell (this will cause more events, however there
    ' will be only one round of them as you now test for an actual change)
Endif
 
Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: Datagridview cell not updating in Windows 2008 SP2 servermemberharvid16 Apr '12 - 3:01 
Thanks Pete and Luc.
 
I'm done with the changes as you suggested.
Question.... [modified]memberArul R Ece10 Apr '12 - 23:42 
Hi

modified 12 Apr '12 - 0:31.

GeneralRe: earthquakeprotectorPete O'Hanlon11 Apr '12 - 0:15 
While that's a terrible shame, is this really the right forum? I would suggest that the GIT would be the appropriate place for this, as that's where you are most likely to find a number of people from Chennai.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


QuestionQuestion related to Windows FormmemberShikha Rani10 Apr '12 - 19:29 
Respected Sir/ Ma'am,
 
I wanted to ask that how to transfer a value of one textbox from one windows form to another??
 
Also plz provide me with your e-mail id, so that i can contact you easily and can send you attachments wherever necessary.....
Thank you.....
AnswerRe: Question related to Windows FormmvpAbhinav S10 Apr '12 - 19:40 
Go through
Passing Values between Forms in .NET 1.x with C# and VB.NET examples[^]
Passing Data Between Forms[^]
QuestionAny suggestions about barcode generation?memberblueskysinger13 Mar '12 - 22:51 
Hi, all,
 
Sorry if this is not the perfect place, but I really need some help here. I'm using this barcode generator to print an barcode image, but here's the thing:
 
I'm inputing
 
Linear upca = new Linear();
Barcode.Data = "12345678912";
Barcode.X = 3;
BarcodeWidth = 120;
 

But the generated Linear Barcode image is always larger than the width that I want, anybody know why?
 
Here's the tutorial, Linear Barcode
http://www.keepautomation.com/product/net_barcode_winforms/linear_barcodes.html]
Any help would be appreciated, thanx!
AnswerRe: Any suggestions about barcode generation?mvpRichard MacCutchan14 Mar '12 - 1:25 
Firstly your link is broken, it should read: http://www.keepautomation.com/products/net_barcode_winforms/linear_barcodes.html[^]; did you not use copy and paste?
Secondly you need to show a bit more of your code and explain exactly what difference there is between tha size you see and the size you expect.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
 


QuestionDo any ad platforms exist for desktop apps?memberjeffb422 Mar '12 - 8:47 
I've written a desktop app using C# WinForms and I'd like to try using ads to generate revenue.   Ad libraries exist for mobile platforms but I haven't come across any which can be used for desktop applications.   Do any exist?   I looked into AdMob, and it looks like there was a point where there was a desktop SDK, but presently AdMob is mobile only.
 
Any suggestions?
 

Thanks,
 
Jeff
AnswerRe: Do any ad platforms exist for desktop apps?mvpDave Kreskowiak2 Mar '12 - 12:42 
Your Google-Fu need much work: ad platform desktop[^]

GeneralRe: Do any ad platforms exist for desktop apps?memberjeffb422 Mar '12 - 13:13 
Yes, I've already done that.   If you look at the results from your search you will see they are for mobile platforms.   There are some hits which state they support desktop but when you go to their site (like Crisp Media) they in fact only support mobile.   So if you know of any ad platforms which actually support Windows desktop, I'd like to know their names.
 
Jeff
GeneralRe: Do any ad platforms exist for desktop apps?mvpDave Kreskowiak2 Mar '12 - 13:40 
It's a long list. Keep reading.
 
Truthfully, it's rare to see ads in a desktop app. I don't think you're going to find anyone with any experience in it. There may be 8,000,000+ members here, but only a handful of those are regulars here and answer questions.
 
You are most likely doing your own research on this one.

Question[VC++] Getting mouse positionmemberkctong5292 Mar '12 - 1:43 
I am a year 1 engineering student and is quite new to programming. Just learnt the very basics of C++ like looping, pointer, array (not even inheritence, etc).
 
Recently I was taught about windows form application, and yet I only know about double-click on button to add some codes in the event-handler upon clicking, and MessageBox::Show(). I will learn some GDI+ and will be required to display some images moving in the form.
 
If I want to develop a dummy gun game, in which a bullet will be displayed upon clicking (using GDI+), I will need to get the current position of the mouse upon clicking. I looked up the msdn and other search engines but just couldn't understand what class or object or function I should use for this purpose. I could only find something like:
 
public:
MouseEventArgs(MouseButtons Button, int Clicks,
int X, int Y, int Delta);
 
But I don't know where I should put it in, and how I can get access to the position X and Y. I would like the whole form to be possible for mouse-clicking without any button. Can someone help me?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 17 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid