小编Mat*_*ias的帖子

来自wcf数据服务的实体框架6数据上下文

我曾经在wcf数据服务服务操作中访问我的(ef 5.0)实体的数据上下文this.CurrentDataSource.MyEntity.我的数据服务继承自DataService<T>.现在我想使用实体框架6.0并在互联网上阅读,我应该继承服务EntityFrameworkDataService<T>.但是现在从我的服务操作中,我再也无法访问我的数据上下文了.this.CurrentDataSource不包含对实体的任何引用.

c# entity-framework wcf-data-services objectcontext

4
推荐指数
1
解决办法
2945
查看次数

Winforms有彩色边框的groupbox

我使用以下代码创建了带有彩色边框的组合框:

Public Class BorderGroupBox
    Inherits GroupBox

    Private _borderColor As Color
    Private _borderWidth As Integer
    Private _borderStyle As ButtonBorderStyle

    ...

    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
        Dim tSize As Size = TextRenderer.MeasureText(Me.Text, Me.Font)
        Dim borderRect As Rectangle = e.ClipRectangle
        borderRect.Y = CInt((borderRect.Y + (tSize.Height / 2)))
        borderRect.Height = CInt((borderRect.Height - (tSize.Height / 2)))
        ControlPaint.DrawBorder(e.Graphics, borderRect, _borderColor, _borderWidth, _borderStyle, BorderColor, _borderWidth, _borderStyle, BorderColor, _borderWidth, _borderStyle, BorderColor, _borderWidth, _borderStyle)
        Dim textRect As Rectangle = e.ClipRectangle
        textRect.X = (textRect.X + 6)
        textRect.Width = …
Run Code Online (Sandbox Code Playgroud)

vb.net groupbox winforms

3
推荐指数
1
解决办法
1万
查看次数