A couple questions

  • Thread starter Thread starter jy836
  • Start date Start date
J

jy836

1) When using images for an application (such as in an ImageList or as the
image for a button), are the images embedded in the application or must the
image files be included in the setup package?

2) Is there a way to adjust the individual column widths of a DataGrid which
has no TableStyles or GridColumnStyles? Also, is there a way to make it
impossible for the user to resize the columns and rows?
 
#1. you can do either way. Embed them as a resource or add them to your
install package and have your app look for them in a particular directory.
#2. Not sure.
james

(I know, not a lot of help)
 
Hi,

2) You need a tablestyle to adjust the column width. You need to create a
new datagrid to prevent the column and row resize.

Public Class NoResizeDataGrid

Inherits DataGrid

Protected Overrides Sub OnMouseDown(ByVal e As
System.Windows.Forms.MouseEventArgs)

Dim hti As DataGrid.HitTestInfo = Me.HitTest(New Point(e.X, e.Y))

If hti.Type = DataGrid.HitTestType.ColumnResize Or hti.Type =
DataGrid.HitTestType.RowResize Then

Return 'no baseclass call

End If

MyBase.OnMouseDown(e)

End Sub





Protected Overrides Sub OnMouseMove(ByVal e As
System.Windows.Forms.MouseEventArgs)

Dim hti As DataGrid.HitTestInfo = Me.HitTest(New Point(e.X, e.Y))

If hti.Type = DataGrid.HitTestType.ColumnResize Or hti.Type =
DataGrid.HitTestType.RowResize Then

Return 'no baseclass call

End If

MyBase.OnMouseMove(e)

End Sub

End Class



Ken
 
james said:
#1. you can do either way. Embed them as a resource or add them to your
install package and have your app look for them in a particular directory.
#2. Not sure.
james

(I know, not a lot of help)

How do you embed an image as a resource (for a button)? Simply by adding an
image to the image property of a button? Thanks.
 
Back
Top