|
My application runs excel 2000 as an automation server. Problem is I cannot get excel to release from the windows processes after the application finishes. I've done internet searches but have not found any thing that works. Any help would be greatful. Thanks.
|
|
|
|
|
hi all,
I'm having a bit of an issue here and maybe one of you guys can help me out .
I'm looking for a way to return all COMPONENTS in a form during run-time, and i mean components including all controls , menu's, custom controls etc.
As you all now a control is a component but a component is not a control.
You will probably think that i'm somesort of idiot , but i'm not (at least i think i'm not), and i've tried every possible way to reach my goal:
1) tried to convert the form as container -> didn't work
2) adding the component that needs to perform above actions and using it's own container as componentcollection holder doesn't work, bcause the container returned is the component itself.
3) returning a menu's container -> doesn't work -> it always returns nothing
batmike2000
|
|
|
|
|
There may be an easier answer than just digging up one for this. What's the final goal you're trying to reach?
|
|
|
|
|
Hi leeland,
the final goal to achieve is a complete component and control iteration of a form to disable /enable them and make them in-/visible if demanded. But this in a dynamic way, cause i never can tell in advance what will be on the Form.
kr.
batmike2000
|
|
|
|
|
tnx Leeland,
i've found the solution: i needed to use reflection
<br />
strFormName = param_Form.Name<br />
<br />
Dim param_Form_type As Type = param_Form.GetType()<br />
Dim compFields As FieldInfo() = param_Form_type.GetFields(BindingFlags.Instance Or BindingFlags.NonPublic)<br />
For Each fiField As FieldInfo In compFields<br />
Dim strCtrl(1) As String<br />
strCtrl = ReturnCompName(fiField, param_Form)<br />
For Each dr As DataRow In myrs.Rows<br />
If strCtrl(0) = dr("SecAuthCtrl_Name") And fiField.FieldType.FullName = dr("SecAuthCtrl_Type") Then<br />
Select Case fiField.FieldType.FullName.ToLower<br />
Case "System.Windows.Forms.ToolBarButton".ToLower<br />
Dim cmp As ToolBarButton = DirectCast(fiField.GetValue(param_Form), ToolBarButton)<br />
cmp.Enabled = dr("SecAuthorized_Enabled")<br />
cmp.Visible = dr("SecAuthorized_Visible")<br />
Case "System.Windows.Forms.MenuItem".ToLower<br />
Dim cmp As MenuItem = DirectCast(fiField.GetValue(param_Form), MenuItem)<br />
cmp.Enabled = dr("SecAuthorized_Enabled")<br />
cmp.Visible = dr("SecAuthorized_Visible")<br />
Case Else<br />
End Select<br />
End If<br />
Next<br />
Next
this works now,
tnx for your effort
batmike2000
|
|
|
|
|
Hi,
In my client application,it requires to access a file in the remote server station within LAN, which requires authentication(User name and password)in VB. Provide me any sample code that has code to authenticate remote PC file access.I am not using ASP or VB.NET.
|
|
|
|
|
|
Hi,
is there a way to prevent highlighting of the selected row in a datagridview? i want to create a usercontrol like the one in the ntfs security tab in the file properties dialog in the windows explorer.
thx
|
|
|
|
|
|
|
I had this same problem once, and I never really figured out a good way to do it. I ended up kinda cheating and just setting the selection highlight to the same color that the row was already. You can set the default row highlight and the alternating row highlight if you use different colors for alternating rows. Here's the code I used:
MyGridView.DefaultCellStyle.SelectionBackColor = Color.White<br />
MyGridView.DefaultCellStyle.SelectionForeColor = Color.Black<br />
MyGridView.AlternatingRowsDefaultCellStyle.SelectionBackColor = My.Settings.ContrastBackColor<br />
MyGridView.AlternatingRowsDefaultCellStyle.SelectionForeColor = My.Settings.ContrastFontColor
Let me know if you find a nicer way!
|
|
|
|
|
this is working good for me. haven't seen the DefaultCellStyle property
thank you very much!
|
|
|
|
|
I am trying to use the getbitmapbits funtion of the mediadet in vb.net,is that possible,My code is given below plz find errors,as it does not respond when getitmapbits function is called.
CODE
Dim width As Integer = 480
Dim heigh As Integer = 640
'Dim mediatype1 As _AMMediaType
' Dim vih As videoinfoheader = mediatype1.
' get buffer size
Dim abuffer As Byte = 0
Dim buffer As IntPtr = IntPtr.Zero
Dim md As MediaDet
md.Filename() = txtFName.Text
md.CurrentStream() = 0
Dim bufferSize1 As Integer = 0
md.GetBitmapBits(0, bufferSize1, abuffer, width, Height)
MessageBox.Show("buffersize got and is = " & bufferSize1)
Dim bmpinfoheaderSize As Integer = 40
Dim bufferSize As Integer = (((width * Height) * 24) / 8) + _ bmpinfoheaderSize
' allocate buffer, then get bitmap bits
buffer = Marshal.AllocHGlobal(bufferSize)
md.GetBitmapBits(0, bufferSize, abuffer, width, Height)
' marshal to struct and then dealloc
'dim header as BitmapInfoHeader = system.Runtime.InteropServices._ Marshal.PtrToStructure(buffer,typeof(BitmapInfoHeader))
Dim p As New Bitmap(width, Height, width * 3,_ Imaging.PixelFormat.Format24bppRgb, New IntPtr(CInt(abuffer) + 40))
PBox.Image() = p
System.Runtime.InteropServices.Marshal.FreeHGlobal(buffer)
Asad
|
|
|
|
|
Hallo,I'm begginer in VB.How am I colorized row in listbox?
Thanks,
|
|
|
|
|
|
How can i move toolStrip in VB.NET 2005 as Microsoft Office Word
................
|
|
|
|
|
|
I don't know how insert icon to ToolStripCOmboBox in VB.NET 2005
................
|
|
|
|
|
|
It can not help me, Can u?
................
|
|
|
|
|
|
I want to open image in my application and store the path in button next and back to display image?
................
|
|
|
|
|
|
Is that a question or a statement?
|
|
|
|
|
It is question
................
|
|
|
|