Predicate toPredicate(Root<employee> root,CriteriaQuery <?> query,CriteriaBuilder cb)
{
Predicate pred=null;
// Returning the rows matching the joining date
pred=cb.equal(root<Emplyoee_>.get("joindate"));
//**//
}
这里ctrList是UserControl的对象,如果是Winform,则是PopCustomer。 我想在相同的位置和相同大小的ctrList打开PopCustomer。
答案 0 :(得分:1)
问题在于,Location
的{{1}}是相对于其父亲的,而对于表格来说,它是相对于屏幕的。{/ p>
如果你改变了这个:
UserControl
到此:
popCus.Location = New Point(ctrList.Location)
然后你会得到你想要的效果。您实际上可以对表单使用相同的代码,这意味着您可以使用popCus.Location = ctrList.PointToScreen(Point.Empty)
参数编写单个方法,然后使用该参数设置新的Control
和Location
形成。然后,您可以调用该方法并将表单或用户控件作为参数传递。