WPF GridSplitter让我的网格比我的窗口宽!
我有一个带有GridSplitter的WPF网格.如果我调整列的大小,那么我可以使网格比窗口宽,不可见.
它是这样开始的:
WPF网格http://img201.imageshack.us/img201/9505/onehg6.jpg
但在扩大左栏后,我再也看不到右栏(绿色):
WPF GridSplitter http://img201.imageshack.us/img201/1804/twomy6.jpg
我究竟做错了什么?如何防止GridSplitter改变网格的大小?
更新:
我还在努力解决这个问题.我现在尝试在网格中嵌套网格.这没有用.这是我的XAML ColumnDefinitions,RowDefinitions和GridSplitters ......
<Window ... >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="150" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" MinWidth="400" />
</Grid.ColumnDefinitions>
<GridSplitter
ResizeDirection="Columns"
ResizeBehavior="BasedOnAlignment"
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Width="2"
Margin="0,5,0,5"
Panel.ZIndex="1"/>
<Grid Grid.Column="0">
...
</Grid>
<Grid Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="150" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" MinWidth="200" />
</Grid.ColumnDefinitions>
<GridSplitter
ResizeDirection="Columns"
ResizeBehavior="PreviousAndNext"
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Width="2"
Margin="0,5,0,5"
Panel.ZIndex="1"/>
<Grid Grid.Column="0">
...
</Grid>
<Grid Grid.Column="2">
...
</Grid>
</Grid>
</Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)
更新: …
是否有一个.NET库我可以用来以编程方式生成我自己的GIF图像?
至少我想逐个像素地构建它.更好的是支持文本和形状.
这是我正在尝试做的一个例子.我在Photoshop中嘲笑了这个...
数字线图形http://img143.imageshack.us/img143/5458/dollarlineot9.gif
您有什么推荐的吗?
有时我在尝试移动,重命名或以其他方式操作计算机上的某些文件或文件夹时会收到此错误消息...
目标文件夹访问被拒绝您需要获得执行此操作的权限http://img222.imageshack.us/img222/1581/destinationfolderaccessms9.jpg
我需要做些什么才能获得控制权?
我正在制作3D编辑器,我希望Windows资源管理器在缩略图视图模式下显示文件中3D模型的预览.
我怎么做?
我正在尝试设置WPF图像的来源.
XAML的工作原理:
<Image Name="ImageThing"
Source="images/Thing.png"/>
Run Code Online (Sandbox Code Playgroud)
Visual Basic失败:
ImageThing.Source = "images/Thing.png"
Run Code Online (Sandbox Code Playgroud)
......有这个例外:
"String"类型的值无法转换为"System.Windows.Media.ImageSource".
如何创建我需要的System.Windows.Media.ImageSource?
此代码改编自MSDN示例:
Dim bmp As New BitmapImage()
bmp.BeginInit()
bmp.UriSource = New Uri("images/Thing.png", UriKind.Relative)
bmp.EndInit()
ImageThing.Source = bmp
Run Code Online (Sandbox Code Playgroud) 我需要设置一个EntityObject的EntityKey.我知道它的类型和它的id值.我不想不必要地查询数据库.
这有效......
//
// POST: /Department/Edit/5
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(Guid id, Department Model)
{
Model.EntityKey = (from Department d in db.Department
where d.Id == id
select d).FirstOrDefault().EntityKey;
db.ApplyPropertyChanges(Model.EntityKey.EntitySetName, Model);
db.SaveChanges();
return RedirectToAction("Index");
}
Run Code Online (Sandbox Code Playgroud)
这失败了......
//
// POST: /Department/Edit/5
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(Guid id, Department Model)
{
String EntitySetName = db.DefaultContainerName + "." + Model.GetType().Name;
Model.EntityKey = new System.Data.EntityKey(EntitySetName, "Id", Model.Id);
db.ApplyPropertyChanges(Model.EntityKey.EntitySetName, Model);
db.SaveChanges();
return RedirectToAction("Index");
}
Run Code Online (Sandbox Code Playgroud)
该ApplyPropertyChanges()线路出现故障与此异常:
ObjectStateManager不包含ObjectStateEntry,其中引用了"Sample.Models.Department"类型的对象.
两个EntityKeys是平等的.为什么第二块代码失败?我该如何解决?
我的孩子UpdatePanel更新其内容及其父UpdatePanel的内容.
<asp:UpdatePanel ID="UpdatePanel1"
runat="server">
...
<asp:UpdatePanel ID="UpdatePanel2"
runat="server">
...
</asp:UpdatePanel>
...
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)
我不希望每次子更新时都更新我的父UpdatePanel.
我继承了一个.NET Framework 1.1网站,我必须在Windows Server 2008上使用IIS 7托管.我遇到了一些麻烦.
我按照这些说明安装了.NET Framework 1.1 .
安装程序自动创建一个新的应用程序池"ASP.NET 1.1".我用它.
当我启动网站时,我看到web.config运行时错误:
标记包含"culture"属性的无效值.
我解决了那个,然后看到:
不允许子节点.
我不想继续玩这个打鼹鼠的游戏.有些事情一定是错的.
我检查自动创建的应用程序池.我看到它是1.1.
高级设置...

基本设置...

这似乎不对.
设置1.1时,它不是高级下拉选择器中的选项.
为什么在Basic框中它只是"v1.1"而不是".NET Framework v1.1.4322"?那会更加一致.
我无法为其他应用程序池选择.NET Framework 1.1.它不是下拉选择器中的一个选项.那是怎么回事?

这就是我所拥有的.有用.但是,有更简单或更好的方法吗?
ASPX页面......
<asp:Repeater ID="RepeaterBooks" runat="server">
<HeaderTemplate>
<table class="report">
<tr>
<th>Published</th>
<th>Title</th>
<th>Author</th>
<th>Price</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Literal ID="LiteralPublished" runat="server" /></td>
<td><asp:Literal ID="LiteralTitle" runat="server" /></td>
<td><asp:Literal ID="LiteralAuthor" runat="server" /></td>
<td><asp:Literal ID="LiteralPrice" runat="server" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Run Code Online (Sandbox Code Playgroud)
ASPX.VB代码背后......
Protected Sub Page_Load( ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim db As New BookstoreDataContext
RepeaterBooks.DataSource = From b In db.Books _
Order By b.Published _
Select b
RepeaterBooks.DataBind()
End Sub
Sub RepeaterBooks_ItemDataBound( ByVal sender As Object, …Run Code Online (Sandbox Code Playgroud) .net ×5
wpf ×3
asp.net ×2
image ×2
.net-1.1 ×1
ajax ×1
asp.net-1.1 ×1
asp.net-ajax ×1
asp.net-mvc ×1
c# ×1
data-binding ×1
gif ×1
grid ×1
html ×1
iis-7 ×1
openid ×1
updatepanel ×1
vb.net ×1
winapi ×1
windows ×1
xaml ×1