Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

sanyexian

@sanyexian
About
Posts
40
Topics
19
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to find a winform by name in VS project?
    S sanyexian

    Hello,everyone! I want to find a winform by its name in my project. At first, I thougt it could return the specific form with codes like below:

    for each iForm as Form in XXX
    'do someting
    return iForm
    next

    Is this right or not? If right, what's the collection included forms of project? If wrong, what should I do? Would you give me some suggestions or demo? Thanks!

    Visual Basic visual-studio tutorial question

  • why it didn't find the control with its name?[SOLVED]
    S sanyexian

    Hello,Henry! Thanks for your suggestion and the artcile.I've read it.It also give me some help!I have solved this quesiton with all you suggest.Finally I found the textboexes were in a form's tabpage's pannel. Thanks all of you!

    Visual Basic help question

  • why it didn't find the control with its name?[SOLVED]
    S sanyexian

    Hi,Simon! I have tried what like you said,but it didn't find the textboxes.In this project, the Form "frmQia" was Inited after I clicked a button and after I inputed some textes in it, I would leave it. The sub that I wrote will be called in another Button_Click event after I leave the form.I think the form "frmQia" has hold the textboxes and their name were right.So...What happened to me...

    Visual Basic help question

  • why it didn't find the control with its name?[SOLVED]
    S sanyexian

    Thank you, I will try it now! :-D

    Visual Basic help question

  • why it didn't find the control with its name?[SOLVED]
    S sanyexian

    Hi,everyone!The Textboxes were in a Tabpage which was in the Form I wrote in code to find. So I should find textboxes I need in frmQia.Tabcontrol1? :wtf:

    Visual Basic help question

  • why it didn't find the control with its name?[SOLVED]
    S sanyexian

    Hello,everyone! I tried to use Sub like below to caculate. But when the project run, the two textboxes which I wanted to get their "Text" value could not find.Could anyone give me some suggestions or help? Thank you!

    Public Function TotalSub(ByVal j As Integer, ByVal diameter As String, ByVal thickness As String, ByVal material As String)
    Dim txtGG, txtYL As TextBox
    Dim b As String = ""
    Dim sum As Single = 0
    For Each ctrl As Control In frmQia.Controls
    If Not TypeOf ctrl Is TextBox Then Continue For
    For i = 1 To j
    If ctrl.Name = "txtTJGG" & i Then
    txtGG = ctrl
    ElseIf ctrl.Name = "txtTJYL" & i Then
    txtYL = ctrl
    End If
    b = Caculate.Weight_Sub(diameter, txtGG.Text, thickness, material, txtYL.Text)
    sum += CSng(b)
    Next
    Next
    Return sum
    End Function

    (I have try to find textboxes like these code in another project with only one form, it could find them. So I don't know why it didn't work when it in a project with some forms:confused::confused:)

    Visual Basic help question

  • disable tabpages click & click treenode to control pages selected
    S sanyexian

    Hello,everyone! I've knowan how to click treenode to make tabpages selected and show, but I don't want users could click the tabpage and selected one of them. I searched in internet and found that it should use a intenger such as "tab = 1" in some Tabcontrol and Tabpage events like this webpage said whick use TabPage1_Validating & TabPage1_Enter like below :

    Private Sub TabPage1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TabPage1.Validating
    If tab = 1 Then
    e.Cancel = True
    Else
    e.Cancel = False
    End If
    End Sub

    Private Sub TabPage1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Enter
    tab = 1 ' setting the selected tab when user gets back to this tab
    End Sub

    I tried it and now the tabpage could not click,but when I clicked treenode, it could not selected tabpage too.In fact,I didn't understand how the code in the webpage made tabpage disable click after I looked up in MSDN... X| Could anyone give me some suggestions and help? Thanks a lot!

    Visual Basic help tutorial question

  • how to make only checked treenode could be clicked?
    S sanyexian

    Hello,Dave! I have put code like "if e.node.checked = true" in the start of the NodeMouseClick Event, but it also link to tappage. I found that I should use AfterSelect Event in MSDN.How silly I am...

    Visual Basic question tutorial

  • how to make only checked treenode could be clicked?
    S sanyexian

    Hello,everyone! I have a treeview with checkboxes, I use "AfterCheck" event and "NodeMouseClick" event and now the treenode could change color and link to tabpages. What I question is , if a treenode didn't be checked, when I clicked the checkbox, the "NodeMouseClick" event also actived, one tabpage was selected;But I wanted that, when I clicked the checkbox, it just make the node be checked, I should clicked the node again to make tabpage display. What should I do with treeview's event?PLZ give me some suggestions! Thx!

    Visual Basic question tutorial

  • A stranger question about Selectsinglenode method
    S sanyexian

    Hello,everyone! Now I use the method "selectsinglenode" with xpath to search in my XML, I find a stranger question.In my project, when I used this method at first, it didn't get the node that I wanted, so I created a new project to try the xpath, it could got the node now.(The same xpath and same XML file) Then I deleted some controls in my project which was about the method(not the new one), create new, then the method could find the node! I can't understand it, same xpath, same function,same value,why it happens?:confused::confused: Hope some one could tell me the reason and give me some suggestion!Thank you! The function that I used to search a node was like below:

    Dim val As String = ""
    Dim xmldoc As New XmlDocument()
    Dim xpath As String
    Try
    xmldoc.Load(Application.StartupPath + "\Flange\Nozzle-Flange-Height.xml")
    Dim xmlnode As XmlNode
    If Not (Standard = "") Then
    xpath = "/Nozzle-Flange-Height/Standard[@value='" + Standard + "']/Flange-type[@type='" + Type + "']/PN[@PN='" + PN + "']/Height[@DN='" + DN + "']"
    xmlnode = xmldoc.SelectSingleNode(xpath)
    If Not xmlnode Is Nothing Then
    val = xmlnode.InnerText
    Else
    MsgBox("Could not find!")
    End If
    Else
    val = ""
    MsgBox("Input by yourself!")
    End If
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    Return val

    Visual Basic xml question

  • How to get selected node in a XML with childnodes and childnodes' childnodes?
    S sanyexian

    Hello,Eaverae! Your suggestion is helpful for me to get more details about the method "SelectedSingleNode".Thank you! I have got my solution like below:

    For Each node1 In list1
    Dim val As String
    val = node1.Attributes("PN").Value
    If val = TextBox1.Text Then
    Dim list2 As XmlNodeList = node1.SelectNodes("Height")
    Dim node2 As XmlNode
    For Each node2 In list2
    Dim val2 As String
    val2 = node2.Attributes("DN").Value
    If val2 = TextBox2.Text Then
    TextBox3.Text = node2.InnerText
    End If
    Next
    End If
    Next

    What's more, I have change the XML element

    <PN>

    to

    <PN PN="1.6">

    :)

    Visual Basic tutorial xml help question

  • How to get selected node in a XML with childnodes and childnodes' childnodes?
    S sanyexian

    Hi,everyone!I have a XML, its structure was like below: <Height> <Standard>4721 <PN>1.6 <A DN="250">300</A> <A DN="350">400</A> <A DN="450">500</A> <A DN="550">600</A> </PN> <PN>2.5 <A DN="250">300</A> <A DN="350">400</A> <A DN="450">500</A> <A DN="550">600</A> </PN> </Standard> </Height> I want to get the selected node's text,for example,when PN = 1.6,DN = 250,the selected node's text was 300;PN=2.5,DN=350,the text should be 400.I tried use "for each node in childnodes",but it returned "1.6 300400500600".How could get the node I wanted? I think that should be first selected "PN",and then get each childnode in . But I don't know how to do this :sigh: PLZ give me some help,thx!

    Visual Basic tutorial xml help question

  • how to make a xml shared in different Forms?
    S sanyexian

    Hi,Gregory! Thanks for your suggestion, my problem has been solved!Thank you very much! :)

    Visual Basic xml tutorial question

  • how to make a xml shared in different Forms?
    S sanyexian

    Hi,everyone! I want that a XML file be open when Form1 had been load, before my application was killed, this XML should stays open and different Form could call it . I tryed use "Public Shared xml as new XmlDocument () ", but in Form2's control event, when I input "xml.", it didn't show the list of properties and methods. It seemed like "Public Shared" disabled? What should I do? Please give me some suggestions! Thank you very much!

    Visual Basic xml tutorial question

  • Writing and saving a XML file?
    S sanyexian

    Hi, Dave! Thanks for you rely. But I didn't get it……Could you take an example for me? Thanks a lot!

    Visual Basic question xml help tutorial

  • Writing and saving a XML file?
    S sanyexian

    Hello,everyone! I have a question about operating XML file. I need to open a XML file which was a template when the application run, after I've input in TextboxA, the XML file could be saved as a new file in one folder. Then open the saved file again and other Textboxes' text will be written in its elements. (In text_changed event). My question is : I know how to open and save a XML file, but after I save it ,if I want to write new text in it , I need to load the file again? When I write all text in XML, it would need open--write--save and repeat much times ?I think it is so fool…… So,could you give me some suggestions or help? Maybe I should use thread? But there are so much controls :sigh: Thanks !

    Visual Basic question xml help tutorial

  • How to finish the pendign input remaining last time?
    S sanyexian

    Hi,Luc! Thank you very much! I will search some articles to read :) By the way,could you give me some keywords for search ;P Thanks!

    Visual Basic question tutorial

  • How to finish the pendign input remaining last time?
    S sanyexian

    Hi,everyone! I have some difficuties in my project. There are a lot of controls such as textbox and combobox in project, my question is: if I just input some values (not all) into these controls and then close the application; when I open the application next time, I want these controls could shown with values that I inputed last time. What should I do to achieve it?Please give me some suggestions, thank you!

    Visual Basic question tutorial

  • How to insert a resources.resx file into Excel?
    S sanyexian

    I've got it! Thank you, Dave!

    Visual Basic question asp-net help tutorial

  • How to insert a resources.resx file into Excel?
    S sanyexian

    Hi,everyone! I want to insert an image into an Excel sheet,I know I could insert an file on disk into Excel sheet using these codes: xlWorkSheet.Shapes.AddPicture("C:\xl_pic.JPG", _ Microsoft.Office.Core.MsoTriState.msoFalse, _ Microsoft.Office.Core.MsoTriState.msoCTrue, 50, 50, 300, 45) But I don't know how can I insert an image of Project Resources.resx File ,could anyone give me some suggestion or help ? Thanks a lot !

    Visual Basic question asp-net help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups