|
Here's the exception:
System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.<br />
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Objects[] args, Boolean synchronous)<br />
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)<br />
at Application.GUI.ModemDataReceived(Objects sender, SerialDataReceivedExentArgs e) in C:\Application\Server
Any ideas?
Thanks,
Aaron
|
|
|
|
|
Woop.... Fixed
All it was, was not finishing the lines with vbCrLf....
9 hours wasted
Thanks anyway,
Aaron
|
|
|
|
|
Hi All,
While calling the SP which updates the TABLE(SQL SERVER) thru Stored Proc,
i'm getting an error "x parameter was not supplied".
x is the datetime value. I ll pass the system time in that parameter.
I'm facing this problem only for the Datetime Values.
No probs with the code as everything works fine in my system where i developed this app. But after deploying in the client machine i'm facing this prob.
Dont ask me how this is happening, but its happening.
Can anyone help me in this issue.
--Raam
|
|
|
|
|
PLease don't cross post. I have just answered this in the sql forum
Bob
Ashfield Consultants Ltd
|
|
|
|
|
If I can have somebody point me in the right direction.
I have a 2 ip cameras, hooked into a network switch. The I have two decoders that hooked into the switch. Now I have VGA monitors on the other side of the decoder.
So I want to write a program that I can press a button click event. And camera 1 will send the video siginal to monitor 1 or 2, depending on what button I click.
How would I go about doing this? I was thinking maybe I control this throught the network switch via rs232. Or can I send a command direct to the camere or decoder, which also has an IP address.
Where would I start looking for stuff on this?
TIA!!
Rudy
|
|
|
|
|
I would choose for a hardware switch solution... Connect both camera's to a switch box which outputs to a monitor. No PC Needed. You can however create something like that, but you need to exactly specify your needs else we cannot help you... I think the solution you want is close to a DirectShow[^] solution but you may have a hard time developing the application. There are some examples out there, I also managed to get something to work in DirectShow... If I can do it, anybody can...
|
|
|
|
|
Hi Ed!
Thank you for the reply. I plan to have one computer, one network switch, and then my monitors and cameras all hooked into a network switch. With a video switch, I can sedn a AT command via RS 232. But a network switch, I'm not sure if I can dial into specify what jack to connect with what jack?
|
|
|
|
|
Anybody can help me please!
I have a asp.net page (vb) where I need to create Dynamic Controls. the situation is as follow
I have two links one is inside the panel (add range) and other is outside the panel (add component).
when I click the addrange then the four text boxes are going to add in the panel and when I click on addcomponent then one panel with dropdown box is going to create on the page. I done it but when I click the addcomponent the panel is adding on the page but the boxes on the first panel comes down with the 2nd added panel and first panel does not contain addrange text boxes. I am using webcontrol files. AddRange.ascx and AddComponent.ascx. my code is as follwo.
-----Add Panel----
'Add Panel (component)
Private Sub AddAndRemovePanel()
Dim c As Control = GetPostBackControl(Page)
If Not IsNothing(c) Then
If c.ID.ToString = "btnAddComponent" Then
ltlCountH2.Text = Convert.ToInt16(ltlCountH2.Text) + 1
End If
End If
PH2.Controls.Clear()
Dim ControlID As Integer = 0
For i As Integer = 0 To (Convert.ToInt16(ltlCountH2.Text) - 1)
Dim DynamicUserControl As AddComponent = LoadControl("AddComponent.ascx")
While InDeletedList1("uc1" & ControlID) = True
ControlID += 1
End While
DynamicUserControl.ID = "uc1" & ControlID
AddHandler DynamicUserControl.RemoveUserControl1, AddressOf Me.HandleRemoveUserControl1
AddHandler DynamicUserControl.SelectComponent, AddressOf Me.handleSelectComponent
PH2.Controls.Add(DynamicUserControl)
ControlID += 1
Next
populateADDComponentDropDown()
' MsgBox(ltlCountH3.Text)
' MsgBox("ltlCountH3=" & ltlCountH3.Text)
' MsgBox("ltlCountH1=" & ltlCountH1.Text)
' MsgBox("ltlCountH2=" & ltlCountH2.Text)
End Sub
Private Function InDeletedList1(ByVal ControlID As String) As Boolean
Dim DeletedList() As String = ltlRemovedH2.Text.Split("|")
For i As Integer = 0 To DeletedList.GetLength(0) - 1
If ControlID.ToLower = DeletedList(i).ToLower Then
Return True
End If
Next
Return False
End Function
Sub HandleRemoveUserControl1(ByVal sender As Object, ByVal e As EventArgs)
Dim DynamicUserControl As AddComponent = sender.parent
PH2.Controls.Remove(sender.parent)
ltlRemovedH2.Text &= DynamicUserControl.ID & "|"
ltlCountH2.Text = Convert.ToInt16(ltlCountH2.Text) - 1
End Sub
--------AddRange-------------
'Add Range in Panel
Private Sub AddAndRemoveDynamicControls2()
Dim c As Control = GetPostBackControl(Page)
If Not IsNothing(c) Then
If c.ID.ToString = "btnAddRange" Then
ltlCountH3.Text = Convert.ToInt16(ltlCountH3.Text) + 1
End If
End If
'PH3.Controls.Clear()
Dim ControlID As Integer = 0
For i As Integer = 0 To (Convert.ToInt16(ltlCountH3.Text) - 1)
Dim DynamicUserControl As WebUserControl = LoadControl("AddRange.ascx")
While InDeletedList("uc3" & ControlID) = True
ControlID += 1
End While
DynamicUserControl.ID = "uc3" & ControlID
AddHandler DynamicUserControl.RemoveUserControl, AddressOf Me.HandleRemoveUserControl2
For Each c2 As Control In PH2.Controls
If c2.GetType.Name.ToLower = "addcomponent_ascx" Then
Dim uc As UserControl = CType(c2, UserControl)
Dim mypanel As Panel = uc.FindControl("panel1")
mypanel.Controls.Add(DynamicUserControl)
Else
MsgBox("not found")
End If
Next
'PH2.Controls.Add(DynamicUserControl)
ControlID += 1
Next
End Sub
Private Function InDeletedList2(ByVal ControlID As String) As Boolean
Dim DeletedList() As String = ltlRemovedH3.Text.Split("|")
For i As Integer = 0 To DeletedList.GetLength(0) - 1
If ControlID.ToLower = DeletedList(i).ToLower Then
Return True
End If
Next
Return False
End Function
Sub HandleRemoveUserControl2(ByVal sender As Object, ByVal e As EventArgs)
Dim DynamicUserControl As WebUserControl = sender.parent
PH3.Controls.Remove(sender.parent)
ltlRemovedH3.Text &= DynamicUserControl.ID & "|"
ltlCountH3.Text = Convert.ToInt16(ltlCountH3.Text) - 1
End Sub
|
|
|
|
|
We have an ASP.NET forum.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
how can i use my datagridview's combobox!
i have problem with connect it to my database
somebody help me!
N.Asgari
|
|
|
|
|
You're going to have to provide more information if you want help. Maybe post some of your code so we can see what is going wrong.
|
|
|
|
|
All,
I have written a code segment to disable the controls in a form...
private void button1_Click(object sender, EventArgs e)
{
foreach (Control cntl in this.Controls)
{
if (cntl.HasChildren)
{
lockControls(cntl);
}
else
{
cntl.Enabled = false;
}
}
}
private void lockControls(Control subcntl)
{
foreach (Control Ncntl in subcntl.Controls)
{
if (Ncntl.HasChildren)
{
lockControls(Ncntl);
}
else
{
Ncntl.Enabled = false;
}
}
}
Here the problem is , this code will disable the form also(i.e. the minimze, maximize & restore buttons of the form); How i can resolve this issue...
Please suggest...thanks in advance...
Sebastian
|
|
|
|
|
First of all, a shorter piece of your code...
private void button1_Click(object sender, EventArgs e)
{
foreach (Control cntl in this.Controls)
lockControls(cntl);
}
private void lockControls(Control ctrl)
{
ctrl.Enabled = false;
foreach (Control childControl in ctrl.Controls)
lockControls(childControl);
}
But why would you also disable all child controls, parent controls do disable child controls once disabled... Anyway, this should work...
|
|
|
|
|
|
Eduard Keilholz wrote: But why would you also disable all child controls, parent controls do disable child controls once disabled...
Yea I agree, disabling the parent is all that is required.
|
|
|
|
|
Am I inthe correct forum!
|
|
|
|
|
hi,
i have one transparent form (opacity=0.5).
now the problem is when there is windows media player running behind that form, either my form is hiding the playing content or the windows media player cannot show media.
|
|
|
|
|
Hi,
This is probably caused by the fact that the mediaplayer is using hardware acceleration to show the video (this is known as a video-overlay).
What that means, is that the mediaplayer is not actually showing the video but just a rectangle with a specific colour, and the videocard will then replace any pixel that has that colour with the video. I believe the video-overlay colour is usually rgb(16,0,16) but it could vary.
Make a form with its backcolor set to 16;0;16 and move it over your mediaplayer: you should see the video playing on your form then.
|
|
|
|
|
Hi Guys,
i am working on a project using vs2005,vb.net.
i have data on a datagrid as follows...
StockCode|Description|Qty,UOM
1234 |TEST |20 |KG
5678 |TEST2 |15 |KG
The Xml format required must be as follows...
<item>
<key>
<stockcode> 1234 </stockcode>
</key>
<description>TEST</description>
<qty>20</qty>
<uom>KG</uom>
</item>
i am currently reading the xml template and creating the xmldoc but it is taking way too long.
What is the fastest way to create this xml, bear in mind that my datagrid may have up to 30000 rows and 80 columns.
thanks
Anoop Brijmohun
|
|
|
|
|
If your grid is bound to a data base using a DataSet, I would like to inform you that you may use WriteXml function of DataSet object.
It will export all data in an Xml file in the desired format.
Such as -
Me.DataSet1.WriteXml("C:\DataSetXml.xml")
-Dave.
------------------------------------
http://www.componentone.com
------------------------------------
|
|
|
|
|
Hi,thanks
The DataGridView has been created by reading a csv file.
I have tried using DataSet.WriteXml and it does not give me the desired output format.
do you have any other ideas?
thanks for your help
Anoop Brijmohun
|
|
|
|
|
Hi
Is it possible to sub-class the fluent ribbon in Word2007 from a VB.NET addin app?
Sub-classing based on NativeWindow object does not seem to work.
Cheers
Rob
|
|
|
|
|
I have a few questions regarding the code below.
In the first highlighted section of the code below the employee names are added into the combo box using a large string array.
' Declare comboBox1 as a ComboBox.
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
' This method initializes the combo box, adding a large string
' array but limiting the drop-down size to six rows so the combo box
' doesn't cover other controls when it expands.
Private Sub InitializeComboBox()
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Dim employees() As String = New String() {"Hamilton, David", _
"Hensien, Kari", "Hammond, Maria", "Harris, Keith", _
"Henshaw, Jeff D.", "Hanson, Mark", "Harnpadoungsataya, Sariya", _
"Harrington, Mark", "Harris, Keith", "Hartwig, Doris", _
"Harui, Roger", "Hassall, Mark", "Hasselberg, Jonas", _
"Harnpadoungsataya, Sariya", "Henshaw, Jeff D.", "Henshaw, Jeff D.", _
"Hensien, Kari", "Harris, Keith", "Henshaw, Jeff D.", _
"Hensien, Kari", "Hasselberg, Jonas", "Harrington, Mark", _
"Hedlund, Magnus", "Hay, Jeff", "Heidepriem, Brandon D."}
ComboBox1.Items.AddRange(employees)
Me.ComboBox1.Location = New System.Drawing.Point(136, 32)
Me.ComboBox1.MaxDropDownItems = 5
Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDown
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(136, 81)
Me.ComboBox1.TabIndex = 0
Me.Controls.Add(Me.ComboBox1)
End Sub
' This method is called when the user changes his or her selection.
' It searches for all occurrences of the selected employee's
' name in the Items array and adds the employee's name and
' the number of occurrences to TextBox1.Text.
' CAUTION This code exposes a known bug: If the index passed to the
' FindStringExact(searchString, index) method is the last index
' of the array, the code throws an exception.
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim comboBox As comboBox = CType(sender, comboBox)
' Save the selected employee's name, because we will remove
' the employee's name from the list.
Dim selectedEmployee = CType(ComboBox1.SelectedItem, String)
Dim count As Integer = 0
Dim resultIndex As Integer = -1
' Call the FindStringExact method to find the first
' occurrence in the list.
resultIndex = ComboBox1.FindStringExact (ComboBox1.SelectedItem)
' Remove the name as it is found, and increment the found count.
' Then call the FindStringExact method again, passing in the index of the
' current found item so the search starts there instead of
' at the beginning of the list.
While (resultIndex <> -1)
ComboBox1.Items.RemoveAt(resultIndex)
count += 1
resultIndex = ComboBox1.FindStringExact _
(selectedEmployee, resultIndex)
End While
' Update the text in Textbox1.
TextBox1.Text = TextBox1.Text & Microsoft.VisualBasic.vbCrLf _
& selectedEmployee & ": " & count
End Sub
1)How do I do the same for datas that are in the database(SQL Server 2000) instead? Do I have to use the below line of code? Or if not, what do I have to do to insert the data into the combo box?
Me.Inv_itemcategoryTableAdapter.Fill(Me.dsInventory.inv_itemcategory)
Inv_itemcategory is the name of the table adapter holding the data. dsInventory is the name of the data source.
2) In the second highlighted section (updating the textbox), can I use the same method to update another combo box and also a text box instead of only updating a text box?
|
|
|
|
|
1 - set the datasource of the combo box to be the datatable that contains the data, and set the DisplayMember
2 - Of course. Where are you stuck ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am calling a third party exe from my application, what I need is, can I set location, size of GUI of that exe from my web page.
thank U all..
kiran
|
|
|
|
|