|
Not everything is that easy.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
How about the events MouseEnter and MouseLeve, I'm sure you can build some logic you want out of that.
|
|
|
|
|
Well, it is not easy to see what problem you are trying to solve. Maybe you should write some test code with all these events wired up and see which comes closest to doing what you want.
|
|
|
|
|
what about windows Messages to intercept the click ? it's possible this ?
the problem I want to solve is this :
When a control has focus and the user click outside , I want to run some code related to the control.
|
|
|
|
|
It depends where the user clicks, which is why you have those events. You really need to study the documentation a bit more, and also do what I suggested and try some testing of your own. And remember, all these events are triggered by mouse move, click, keyboard, etc., in the first place.
|
|
|
|
|
dilkonika wrote: what about windows Messages to intercept the click ? it's possible this ? You cannot intercept clicks in other applications. Another application would also be "outside the control". You'd need a mouse-hook.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I'm interesting only about clicks outside the control but inside my application.
|
|
|
|
|
dilkonika wrote:
I'm interesting only about clicks outside the
control but inside my application. Aight, next problem; you won't get any mouse-events on the forms that are currently showing a modal form. You can only get the ones for the active forms (active modal and modeless).
It feels like adding an "end of editing" event - but the default way to do so is by checking the focus, not where the user clicks. Can you provide more context?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
ok but how to resolve the problem when user click on a control that can't get focus , so the control doesn't loose the focus , but the user has clicked outside ?
|
|
|
|
|
dilkonika wrote:
ok but how to resolve the problem when user click
on a control that can't get focus , so the control doesn't loose the focus , but
the user has clicked outside ? You'd need to hook into all .click events of each control. Once the event is triggered, notify the control that has focus.
Create a public method to call on the control you're targetting; call it "LostFocusButNotQuite" or similar. In the constructor you loop each control, see if it has a mouse-clicked event using reflection, hook it, and when called have it cast the sender and (if null != sender) call the method.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Quote: You'd need to hook into all .click events of each control. Once the event is triggered, notify the control that has focus
In my form I have over 40 controls ??!!
For what I'm asking if is possible to follow a general way. ( using windows message or ??? )
Anyway , your method doesn't include 2 details :
- clicking on the form
- Clicking on another form
|
|
|
|
|
dilkonika wrote: In my form I have over 40 controls ??!! And??!!
dilkonika wrote: Anyway , your method doesn't include 2 details A form is a control.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I'm using System.Linq.Dynamic I have this code :
Imports System.Linq.Dynamic
.....
Dim mylist As IQueryable(Of Myobject)
Dim ob1 As New List(Of ObjectParameter)
Dim dynstr as string=string.empty
dynstr += "id= @id"
ob1.Add(New ObjectParameter("id", 26))
mylist=context.MyObjects.Where(dynstr,ob1.ToArray()).Tolist
I'm expecting that MyList contain only 1 object with id=26 , but MyList contains all the objects inside MyObjects. So it seems that the Where clause has no effect.
It's strange because if I change the dynstr to :
dynstr+="id=26"
everything works ok. so it seems that the dynstr string "doesn't communicate" with objectParameter list inside the where clause.
What can I do ? Thank you !
|
|
|
|
|
Are you using "id = @id ", or "it.id = @id " as per your post on the MSDN forum[^]?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Try using numbered parameters:
Dim mylist As IQueryable(Of Myobject)
Dim ob1 As New List(Of Object)
Dim dynstr as string = string.empty
dynstr += "id = @0"
ob1.Add(26)
mylist = context.MyObjects.Where(dynstr, ob1.ToArray()).Tolist
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yes , but how will I know that a parameter will be 0 , 1 or 2 so I can construct the dnstr as you wrote ?
The general scenario is like this :
If condition1 - change the dynstr , Add new parameter
If condition2 - change the dynstr , add new parameter
if condition3 - change the dynstr , add a new parameter.
If all the condition are true , your solution will work because the first will have @0 on string , the second @1 , the third @2.
But if only the condition3 is true , the third parameter will have @0.
|
|
|
|
|
Something like this:
Dim mylist As IQueryable(Of Myobject)
Dim ob1 As New List(Of Object)
Dim filter As New List(Of String)
If condition1 Then
filter.Add("id = @" & ob1.Count)
ob1.Add(idToFind)
End If
If condition2 Then
filter.Add("field2 = @" & ob1.Count)
ob1.Add(field2Value)
End If
...
Dim dynstr As String = String.Join(" AND ", filter)
mylist = context.MyObjects.Where(dynstr, ob1.ToArray()).ToList
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
basically i m creating vb.net window application which can show the result in rdlc report...
at the back end it is SQL server 2008.
Is there any easy way to fill RDLC tablix based on row and column grouping.
The situation is as follows.
I have a table in SQL server like this
Course Adcat sub1 sub2 sub3 sub4 sub5
Ba1 Reg HL Hlit His PS Env
Ba1 Reg EL Hlit HS Socio Env
Ba1 Pri HL His Hlit HS Env
Ba1 Reg SL Socio Slit PS Env
This is just like a different course student registered in different categories and opted different subjects and it is stored in five columns as shown above.
I just want to see the report in RDLC like this
Course subject Reg Pri
BA1 HL 1 1
EL 1 0
SL 1 0
Hlit 2 1
His 1 2
PS 1 1
HS 1 0
Socio 2 0
AND SO NO.
I just want to count the number of subjects from above mention five columns.
Please help me for this
i am using VB.NET window application and Sql server 2008. Thanx in advance.
|
|
|
|
|
Your output doesn't seem to match your input data, but something like this should work:
SELECT
T.Course,
S.subject,
SUM(CASE T.Adcat WHEN 'Reg' THEN 1 ELSE 0 END) As Reg,
SUM(CASE T.Adcat WHEN 'Pri' THEN 1 ELSE 0 END) As Pri
FROM
YourTable As T
CROSS APPLY
(
VALUES (sub1), (sub2), (sub3), (sub4), (sub5)
) As S (subject)
GROUP BY
T.Course,
S.subject
ORDER BY
T.Course,
S.subject
;
http://sqlfiddle.com/#!3/095e8/1[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
but it is in vb.net window application.
where to use the cade????????
|
|
|
|
|
Use the query to create a view in your SQL database. Add the view to the report as a dataset.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thanks for quick response..("_")
is there a way to use grouping in rdlc report tablix.
|
|
|
|
|
|
sorry but its not i am looking for.....
|
|
|
|
|
The query I posted will produce the output you said you wanted.
If that's not what you're looking for, then you'll need to explain what you are looking for.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|