Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello insert text in this place and using the textbox?


VB
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
    For Each webpageelement As HtmlElement In allelements

        If webpageelement.GetAttribute("guidedhelpid") = "sharebox_editor" Then
            webpageelement.InvokeMember("click")
        End If
    Next
End Sub


sharebox_editor this box to comments.
Posted

1 solution

The question is not clear, but if you're asking how to get control reference...

You already found the control via GetAttribute. Just cast it into proper type instead of generic html element.

VB
If TypeOf webpageelement is TextBox
    dim txt as TextBox = DirectCast(webpagelement, TextBox)
    txt.Text = "Your text"
End If


If this solves your problem, please take the time and accept this solution so you help others with similar problem(s).
 
Share this answer
 
v2
Comments
Łuki Gra 4-Sep-14 6:43am    
It does not work, the box code is as follows can help.

<div class="Rd" guidedhelpid="sharebox_editor">
<div class="eg">
<div class="yw oo"></div>
<div class="yw VK"></div>
</div>
<div class="URaP8 Kf Pf b-K b-K-Xb">
<div id="28" class="pq">Add a text...</div>
<div id=":0.f" class="df b-K b-K-Xb URaP8 editable" contenteditable="true" g_editable="true" role="textbox" aria-labelledby="28"></div>
Sinisa Hajnal 4-Sep-14 15:30pm    
Check FindControl method and find your particular div in this case 28.
Łuki Gra 5-Sep-14 14:19pm    
any suggestions?
Sinisa Hajnal 7-Sep-14 8:28am    
Yes, check FindControl method and find your particular div (in this case 28) - that is how you learn, read the documentation on function and adapt the function I posted above.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900