Click here to Skip to main content
15,891,529 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Color of a Pixel in a image in a pictureBox Pin
The ANZAC17-Feb-07 14:11
The ANZAC17-Feb-07 14:11 
QuestionHow do i store my font and return back. Pin
.NetRams16-Feb-07 22:30
.NetRams16-Feb-07 22:30 
AnswerRe: How do i store my font and return back. Pin
Dave Kreskowiak17-Feb-07 10:37
mveDave Kreskowiak17-Feb-07 10:37 
QuestionHow to use AddressOf with a Function in an API into VB.Net Pin
MammadAlimoradi16-Feb-07 22:04
MammadAlimoradi16-Feb-07 22:04 
AnswerRe: How to use AddressOf with a Function in an API into VB.Net Pin
Dave Kreskowiak17-Feb-07 10:33
mveDave Kreskowiak17-Feb-07 10:33 
QuestionHow do i know my control have Set BringtoFront? Pin
.NetRams16-Feb-07 21:57
.NetRams16-Feb-07 21:57 
AnswerRe: How do i know my control have Set BringtoFront? Pin
Dave Kreskowiak17-Feb-07 10:26
mveDave Kreskowiak17-Feb-07 10:26 
QuestionControls created on one thread cannot be parented to a control on a different thread. Pin
charchabil0316-Feb-07 20:39
charchabil0316-Feb-07 20:39 
Hello Guys,
I am trying to mark locations on a map (x,y pixels are derived from a DB)
This is the code that i am using

Private Sub DisplayOnSoftMap()<br />
  SqlQuey = "Select * FROM SoftwareMap WHERE SoftwareMap.SMSID =myRndTrip.CurrentSwitch.SID & "'"<br />
 tmpSoftMapCol = tmpSoftMapCol.GetAllSoftwareMap(SqlQuey)<br />
 For Each tmpSoftMap In tmpSoftMapCol<br />
<br />
 DrowLabel(tmpSoftMap.XMap, tmpSoftMap.YMap, tmpSoftMap.LablName)<br />
<br />
next<br />
<br />
 Private Sub DrowLabel(ByVal X As Long, ByVal Y As Long, ByVal lblText As String)<br />
<br />
        Dim LIndex, Lcount As Integer<br />
        Try<br />
            If Lbl Is Nothing Then<br />
                ReDim Preserve Lbl(0)<br />
                Lcount = 1<br />
                LIndex = 0<br />
            Else<br />
                Lcount = Lbl.Length<br />
                ReDim Preserve Lbl(Lcount)<br />
                LIndex = Lcount<br />
            End If<br />
            Lbl(LIndex) = New LinkLabel<br />
            Control.CheckForIllegalCrossThreadCalls = False<br />
            Lbl(LIndex).Location = New System.Drawing.Point(X, Y)<br />
            Lbl(LIndex).Text = lblText<br />
            <br />
            Lbl(LIndex).Visible = True<br />
            Lbl(LIndex).AutoSize = True<br />
            Control.CheckForIllegalCrossThreadCalls = False<br />
            Me.Controls.Add(Lbl(LIndex))<br />
            AddHandler Lbl(LIndex).Click, AddressOf Label_Click<br />
        Catch ex As Exception<br />
            Throw ex<br />
        End Try<br />
    End Sub


And this is the Error that Occurs

System.ArgumentException was caught
Message="Controls created on one thread cannot be parented to a control on a different thread."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Form.ControlCollection.Add(Control value)
at RoundTrip.frmRoundTrip.DrowLabel(Int64 X, Int64 Y, String lblText)
--


The purpose of this code is to mark locations on a map,
I would be glad: if you help me finding the solution or any other solution which fits my needs

Regards
Ramy

AnswerRe: Controls created on one thread cannot be parented to a control on a different thread. [modified] Pin
TwoFaced16-Feb-07 22:15
TwoFaced16-Feb-07 22:15 
GeneralRe: Controls created on one thread cannot be parented to a control on a different thread. Pin
charchabil0317-Feb-07 6:09
charchabil0317-Feb-07 6:09 
QuestionAdding additional text to Dropdown list Pin
Praveen 12316-Feb-07 17:41
Praveen 12316-Feb-07 17:41 
QuestionCreating a new row. Pin
v45030516-Feb-07 15:09
v45030516-Feb-07 15:09 
AnswerRe: Creating a new row. Pin
_mubashir17-Feb-07 8:37
_mubashir17-Feb-07 8:37 
GeneralRe: Creating a new row. Pin
v45030518-Feb-07 4:45
v45030518-Feb-07 4:45 
AnswerRe: Creating a new row. Pin
GoodID19-Feb-07 22:49
GoodID19-Feb-07 22:49 
QuestionPopup dialog in a screensaver Pin
jim_taylor16-Feb-07 9:56
jim_taylor16-Feb-07 9:56 
Questionpdf read files Pin
haggenx16-Feb-07 8:11
haggenx16-Feb-07 8:11 
AnswerRe: pdf read files Pin
Dave Kreskowiak16-Feb-07 8:36
mveDave Kreskowiak16-Feb-07 8:36 
GeneralRe: pdf read files Pin
haggenx20-Feb-07 8:25
haggenx20-Feb-07 8:25 
AnswerRe: pdf read files Pin
KreativeKai16-Feb-07 9:17
professionalKreativeKai16-Feb-07 9:17 
AnswerRe: Calculating the number of days Pin
Stefan Troschuetz16-Feb-07 5:09
Stefan Troschuetz16-Feb-07 5:09 
Questionvb-com error 70 Pin
aamn116-Feb-07 2:28
aamn116-Feb-07 2:28 
AnswerRe: vb-com error 70 Pin
Dave Kreskowiak16-Feb-07 4:39
mveDave Kreskowiak16-Feb-07 4:39 
QuestionRe: vb-com error 70 Pin
aamn15-Mar-07 1:43
aamn15-Mar-07 1:43 
AnswerRe: vb-com error 70 Pin
Dave Kreskowiak5-Mar-07 3:09
mveDave Kreskowiak5-Mar-07 3:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.