OBT.Anchor = AnchorStyles.Bottom Or AnchorStyles.RightĪddHandler oBT.Click, AddressOf Me. OTB.Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Bottom Or AnchorStyles.Right MF.Size = New Drawing.Size( 300, 150) 'Width, Heigthĭim oTB As = AddTB(5, 30, " sometext", 270) MsgBox("TextBox one value: " & TB(0).Text) OBT.Location = New Drawing.Point(PosX, PosY)ĪddHandler oBT.Click, AddressOf Me.ExitButtonClick Private Function AddBT(PosX As Integer, PosY As Integer, Caption As String, Optional Width As Integer = 80) As īT(LC).Location = New Drawing.Point(PosX, PosY)ĭim PosX As Integer = MF.Width - (oBT.Width * 1.3)ĭim PosY As Integer = MF.Height - (oBT.Height * 3) PB(LC).Location = New Drawing.Point(PosX, PosY) If PicPath vbNullString And System.IO.File.Exists(PicPath) Then Private Function AddPB(PosX As Integer, PosY As Integer, PicPath As String, Optional Width As Integer = 0, Optional Height As Integer = 0) As Private Function AddCB(PosX As Integer, PosY As Integer, Values() As String, Optional Width As Integer = 100) As ĬB(LC) = New ĬB(LC).Location = New Drawing.Point(PosX, PosY) TB(LC).Location = New Drawing.Point(PosX, PosY) Private Function AddTB(PosX As Integer, PosY As Integer, Optional Caption As String = vbNullString, Optional Width As Integer = 100) As LB(LC).Location = New Drawing.Point(PosX, PosY) Private Function AddLB(PosX As Integer, PosY As Integer, Optional Caption As String = vbNullString, Optional Width As Integer = 100) As MF.StartPosition = FormStartPosition.CenterScreenĪddCB(120, 5,, 150)ĭim oBT As Button = AddBT(100, 231, "Do stuff")ĪddHandler oBT.Click, AddressOf Me.DoStuffĭim oDoc As Document = ThisApplication.ActiveDocument MF.Font = New Drawing.Font(MF.Font.FontFamily, 10) MF.Size = New Drawing.Size( 300, 300) 'Width, Heigth Private Sub CreateForm(Optional Name As String = vbNullString) VbNewLine & "TextBox one value: " & TB(0).Text) What you describe here should not be that hard to implement: make the MDIParentForm your main form (do not modify the Program. MsgBox("ComboBox one value: " & CB(0).Text & vbNewLine & "ComboBox two value: " & CB(1).Text & _ To find the parameters passed to each of the elements just scroll to it and read it's header. Orange - sub-function executed on the "Do stuff" button-click Green - shows a textbox (after the form closes) with the values entered in the comboboxes To "see" what it does just paste it into a new iLogic rule and run it. #Vb net menustrip not visible code#Hey guys, I'd like to share some lines of my code as I believe it might be useful to someone.Īll it does is it creates a custom VB.Net form (on each run) and adds some dynamic elements to it (combobox, textbox, picture, button.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |