Monday, January 18, 2010

Access and set properties for controls on main page inside an iframe page using vb.net 1.*?

Hi





I have a asp.net page (index.aspx) which has an inframe in which I opened another page (questions.aspx). If a button on the questions page is clicked, I want to change the url of a server image control that is on the main page. How do I do this and how do I in general, access and set properties of main form controls from a page in the in-frame?





Thanking you in advance.





ZabronAccess and set properties for controls on main page inside an iframe page using vb.net 1.*?
If you want to use .NET functionality, you'll need to either redraw the entire main page, including the iframe or seriously hack the client side controls. If you are using a tamper-proof viewstate, the hacking option isn't possible. I wouldn't recommend that anyway, as an update to the .NET runtime might invalidate your hack.





If you don't mind doing this on the client and not affecting the server side view of the controls, you can use CSS and javascript to locate the main frame (the ';top'; object) and change the image, for example:





top.myImage.src = ';whatever.jpg';;





Another option is to write a custom control in place of the iframe. This option is pretty complicated and you should look in the documentation for writing a custom control to learn how to do basic custom controls. A last option would be to use an included page instead of an iframe, this would put all the contorls on the same level (i.e. no iframe) which makes it easier for .NET controls to communicate with each other on th client side and still stay synchronized with the server side.

In vb.net (express edition), why the variable declarations for the form controls is not shown in the code?

What I mean for example is, why when you create a button from the toolbox, the button has a variable but is not reflected in the code?





I mean, if you create a button with name ';button1'; and in the code you type ';dim button1 as string';, you get message that is already declared but you do not see the declaration in the code.





Would be interesting for me to see answers for this.


Thanks in advance.In vb.net (express edition), why the variable declarations for the form controls is not shown in the code?
Well, I have the standard edition of VS2005, If your form is form1.vb, you also have a file form1.designer.vb. The button is there.In vb.net (express edition), why the variable declarations for the form controls is not shown in the code?
I rarely touch VB but this is something I stumbled upon before: rename the files to .txt or somehow read it as text and you'll see the entire codes; programming GUIs within same code are possible beginning Java and C#, VB and .Net version of it Microsoft would have you think there is no code required for its GUI portion.
  • topical cream
  • VB.net raise events, calling other forms controls?

    Hi, I am struggling to adapt to vb.net.


    I need to know how to call another forms control from another form





    e.g. if i was on form 2 and clicked a control, and I wanted to call cmdbtn1 on form1, what would I write, like in vb6 this was just 'call form1.cmdbtn1_click '


    But every time I try anything like this it says: 'use raise events instead , not a member of windows.forms.form2'





    I really need help on this so I would very much appreciate it, thanks.VB.net raise events, calling other forms controls?
    You could put whatever you want to do in cmdbtn1_click in a class. Then you can access that function from both forms. If you need to access controls on the form then you can just pass the form to the function or create an overrideable function.





    EG:





    Public Function Overrides DoSomething(frm1 as form)


    End Function





    Or try





    Raise Events form1.cmdbtn1_click





    hth

    VB.NET, one event for multiple controls?

    I came across an example that looks like this:





    Public Sub OnClockTick2(ByVal sender As Object, ByVal e As


    EventArgs) Handles MyFirstButton.Click, MySecondButton.Click


    Console.WriteLine(';Received a click event of first or second button';)


    End Sub





    which gives me an idea of what I am trying to do. I have a form with multiple textboxes, and I want to do the same thing for each of those textboxes when text is changed in any of them. My question is, however, how do I determine which textbox was changed? Would it have something to do with ';sender'; ?





    thanks!!VB.NET, one event for multiple controls?
    sender is an Object.


    All Objects have an Equals() method for reference comparison.





    Compare sender to MyFirstButton with a simple if..else statement.

    VB.NET, one event for multiple controls?

    I came across an example that looks like this:





    Public Sub OnClockTick2(ByVal sender As Object, ByVal e As


    EventArgs) Handles MyFirstButton.Click, MySecondButton.Click


    Console.WriteLine(';Received a click event of first or second button';)


    End Sub





    which gives me an idea of what I am trying to do. I have a form with multiple textboxes, and I want to do the same thing for each of those textboxes when text is changed in any of them. My question is, however, how do I determine which textbox was changed? Would it have something to do with ';sender'; ?





    thanks!!VB.NET, one event for multiple controls?
    sender is an Object.


    All Objects have an Equals() method for reference comparison.





    Compare sender to MyFirstButton with a simple if..else statement.

    Is it posibble to add controls dynamically in Visula studio VB.net? how?

    uh, what your talking about... you mean programmaticaly, you find the control you want you make a new instance of it and then you it to your form like so...





    yourcontrolhere As New ListView()


    Form1.Controls.Add(yourcontrolhere)Is it posibble to add controls dynamically in Visula studio VB.net? how?
    Yes, and I'm assuming that you're doing a WinForms application.





    Use the Add method of the Controls collection object of your current form, for example:





    Dim txtName as New TextBox();


    'you can set properties for this control too


    ...





    Me.Controls.Add(txtName);Is it posibble to add controls dynamically in Visula studio VB.net? how?
    Yes you can surely do this. Following is a method which adds a button (for example) to your form dynamically. When you will call this method, this will add a button to your form. You can add other controls likewise.





    Private Sub CreatButton()


    Dim btnYes As System.Windows.Forms.Button


    ' Create control


    btnYes = New System.Windows.Forms.Button()


    ' Set button properties


    btnYes.Name = ';ButtonYes';


    btnYes.Size = New System.Drawing.Size(70, 30)


    btnYes.Location = New System.Drawing.Point(300, 30)


    btn.TabIndex = 1


    btnYes.Text = ';YES';


    ' add to the parent form's controls collection


    Me.Controls.Add(btnYes)


    End Sub





    Hope that answers the question

    How to change the place of controls in a form of vb.net?

    you should view your form in Design view and change the controls' places with your mouse! is it so hard, or I didn't understand?!

    VB.NET Looping through user controls on a page?

    I have a user control that's added to my page. Inside that user control is a checkbox and on the main page I have a button. When I click that button I need to know which of the checkboxes are checked.





    How do I loop through the user controls on a page?VB.NET Looping through user controls on a page?
    First of all, you should go over to forums.asp.net. You'll get better help there for .NET related code.


    Second of all, I am a C# developer, so I will do my best to write the VB code.





    I'm not sure I fully understand your situation. You may want to reword your question more clearly. But I can see two possible scenarios you might be encountering.





    Scenario A:


    You have multiple instances of the same UserControl on your page and you need to (from the Page) get a list of the CheckBox controls inside these UserControls that are checked?





    Scenario B:


    You have a single instance of the UserControl on your page and you need to get a list of the CheckBox controls inside it that are checked.





    Let me start off by saying, this isn't a very good design. You may want to rethink this to make it work better. A UserControl is a way of encapsulating controls (and their related logic). You should never try to access the controls inside it from an outside class. That kind of breaks the fundamental princible of OOP. However, what you could do is create a public property on your UserControl that would return the selected checkboxes as a List%26lt;CheckBox%26gt; or something.





    In C# this would be:


    private List%26lt;ListItem%26gt; _SelectedCheckBoxes;


    public List%26lt; ListItem %26gt; SelectedCheckBoxes {


    get


    {


    if (_SelectedCheckBoxes == null) {


    _SelectedCheckBoxes = new List%26lt;ListItem%26gt;();


    foreach (ListItem item in theCheckBoxList.Items) {


    if (item.Selected) {


    _SelectedCheckBoxes.Add(item);


    }


    }


    }


    return _SelectedCheckBoxes;


    }








    From your Page you would then have a myUserControl.SelectedCheckBoxes property.





    Hope some of that helps.VB.NET Looping through user controls on a page?
    You do know that you can reference the checkbox directly from the form, right?


    Assuming that the GenerateMember property of the checkbox is set to true, you can just do:





    If control.CheckBox1.Checked Then ...





    But if you really want to loop through all the controls on the user control:





    For Each c As Control In control.Controls


    聽聽If TypeOf c Is CheckBox Then


    聽聽聽聽If CType(c, CheckBox).Checked Then


    聽聽聽聽聽聽MsgBox(c.Text)


    聽聽聽聽End If


    聽聽End If


    Next
  • topical cream
  • VB.NET Coping with many controls?

    I've come to a point in project that there are roughly 500-600 controls on one form, these are all organized into groupbox/panels/tabs. The problem I'm getting is that I've run out of space and now just moving one panel to the side is connecting with a group box in another one you cant even see, could anybody please point me in the right direction on how combat this?





    Is it possible to turn automatic parenting of controls? I'm pretty happy with my layout, I just need to move things about now and again.VB.NET Coping with many controls?
    That many controls? Are they all necessary? Could you not simplify your form or have more than one form?





    Instead of having tabs, have another form, then on Userform1 you can insert a button to show Userform2 instead of selecting a tab?





    Then you could have multiple tabs (you can have more than one tab-page-book on one form) on multiple forms.





    There's more than one way to skin a cat. Is the way you're doing it now the best/easiest way?

    Type controls list in vb.net?

    I'm sorry, can you clarify your question? Are you asking for a list of controls in vb.net, what type is a control list in vb.net, or list of type controls in vb.net?





    what version of visual studios and framework are you wanting to know about?





    here's the new controls in the VS2005:


    http://visualbasic.about.com/od/usingvbn鈥?/a>

    Custom Controls in VB.net?

    I am working in Visual Studio 2008 (VB.Net) on a Bingo game for my wife. The game will have 18 faces (individual bingo cards) and I am using individual labels (25 per face) and writing the label value from arrays of random numbers. This is great but, the individual naming of all the labels gets to be a bit tedious after a while. IE f1_bp1, f1_bp2 where f1 means face 1 and bp1 and 2 would be B row Position 1 and 2.


    My question is this, is there a way that I can take my first finished card and make it into a custom control and then just add 18 of them onto my form, perhaps loading the labels with a couple arrays? Any help would be great, as I've been promising her this for 6 months now.Custom Controls in VB.net?
    Okay. If I understand you correctly your're writing the same code 18 times? You can use a custom control.





    In visual studio go to new, and select WebUserControl ( or something like it ). It will have an extension of .ascx.





    Create you're entire bingo card within the .ascx page.





    Now on the page you want to use the custom bingo card control put this at the top...(my syntax may be wrong)





    %26lt;%@ Register TagPrefix=';UC'; TagName=';TestControl'; Src=';test.ascx'; %%26gt;';





    now anywhere you want to use this control you'll be able to insert similar to any asp:Label control but you'll have to use you're custom code...like the following





    %26lt;UC:TestControl id=';MyBingoControl'; runat=';Server'; /%26gt;





    Well I hope that helps....





    Check out this page.


    http://support.microsoft.com/kb/893667

    Resize Controls in VB.NET on Form Resize?

    How would I automatically have a tab container resize to take up all but 20 pixels of each side of the form when the form resizes and then have a web browser inside the tab container resize to take up the entire container on resize?





    Thank you.Resize Controls in VB.NET on Form Resize?
    Set the tab container's anchors to all four sides. Do the same for the browser.


    The anchors can be found in the Properties pane on the form designer.Resize Controls in VB.NET on Form Resize?
    On form resize, do your calculations (40 pixels less than the form width, for example) then resize and position the control (the tab container, in this case).

    What are the controls for VB.net?

    i already know about the WebBrowser and UserControl controls but there are more that i do not know.What are the controls for VB.net?
    Controls are anything that you see in the tools menu. There are hundreds of controls. buttons, labels, textbox's...ect ect.What are the controls for VB.net?
    There are an almost unlimited number of controls for most .Net languages. Trying to get a list of them to work through is a thoroughly pointless task - particularly as 99% of controls that exist you will never need in your life as a programmer.


    Learn these things as you go - there's too much to know to try and learn it all before you start.

    Where can i get good visual basic (6.0 not vb.net) user controls?

    i need it for my thesis.. . .





    :pWhere can i get good visual basic (6.0 not vb.net) user controls?
    Check out happyhippo.net, you can get tons of free programs there.Where can i get good visual basic (6.0 not vb.net) user controls?
    You search in:


    1) http://download.com


    2) http://pscode.com





    For free VB codes, visit: http://smartcoder.awardspace.com








    KaBalweg


    http://smartcoder.awardspace.com
    The code project is good source of free code, controls, tutorials etc -





    http://www.codeproject.com
  • topical cream
  • I want to handle events in Vb.net when controls are added with arrays?

    It's pretty easy to do. Here is a piece of code that creates an array of buttons each with a click event handler:





    Dim buttons(4) As Button





    For i As Integer = 0 To 3


    buttons(i) = New Button


    buttons(i).Top = i * 50


    buttons(i).Height = 40


    buttons(i).Width = 100


    buttons(i).Text = ';Button';


    AddHandler buttons(i).Click, AddressOf Button1_Click


    Me.Controls.Add(buttons(i))


    Next





    The AddHandler command will cause each button to call the event function Button1_Click when it is clicked.





    I want to handle events in Vb.net when controls are added with arrays?
    You can't handle events of objects in arrays.

    How to display controls at runtime in VB.NET 2003 depending upon user input?

    I have 6 group box in a form made at design time and each of them have other controls. I want to display these controls depending upom the integer value entered by the user at run time.


    I know how to make controls at run time but i Dont know how to display controls that are already present........ Please do it using loop.How to display controls at runtime in VB.NET 2003 depending upon user input?
    You toggle the Visible property (and, to be extra-safe, the Enabled property) on the controls to be true or false.





    Am I the only person left on Earth who reads documentation?





    http://msdn2.microsoft.com/en-us/library鈥?/a>

    How can I loop through form controls in VB.NET 2008 ?

    I have several labels on a form named sequentially lblTemp0, lblTemp1, lblTemp2, etc.. I want to loop through these and modify their caption. In VB 6 I used the following code.





    For X = 0 to 25


    Me(';lblTemp'; %26amp; X).Caption = gTemp(X)


    Next X





    The me(';lblTemp'; %26amp; X).Text code does not work in VB.NET 2008.





    Thanks.


    TimHow can I loop through form controls in VB.NET 2008 ?
    'Cycle through all controls in the form - set to ME because


    'it is run from the form class


    For Each objcontrol As Control In Me.Controls


    'Check that the control is a label control and that the name contains the word lbltemp


    'if it does then set it to equal the word sometext


    If objcontrol.GetType.ToString = ';System.Windows.Forms.Label'; And objcontrol.Name.Contains(';lblTemp';) _


    Then objcontrol.Text = ';sometext';


    Next





    You can play with your own if statements that i've made there. For instance you can return the last character from the name convert to integer do some math and put the text in to match the result. Whatever you want really





    Hope this is clear

    Can i develop remote desktop controlling software using vb.net? if so, how difficult is it?

    remote desktop controlling like net spy. Here's the publisher's description of net spy software:





    Net Spy Pro is the ultimate combination network monitoring and remote control software tool. Watch multiple user screens at your workstation in real time. View Web sites visited, applications ran and more. Watch keystrokes as they happen. Remotely view a workstation's full-size desktop, send an alert message to a user, end a process and even take control of any PC using your keyboard and mouse.Can i develop remote desktop controlling software using vb.net? if so, how difficult is it?
    It is very easy to see the screen of a remote computer with vb.net. I know because I have done it. Remote controlling is harder, but I have also done that using the windows API. There is no way (that I know of) to control a users mouse without using the API.





    All of that being said, there is %26lt;almost%26gt; no legitimate reason to use this type of software which is why I will not offer any code for this. If you want to know where users are web browsing, there are easier ways - router logs come to mind.If you need to control a remote PC, then there are many free admin tools already available for you to use like RDC, and ultraVNC.





    There is no reason to ever watch someones keystrokes unless you think that you are a hacker and are trying to steal passwords. If that's your deal, then good-on-you and I hope you get caught and sent to prison.Can i develop remote desktop controlling software using vb.net? if so, how difficult is it?
    take a look at this desktop monitoring and controlling software, may give u some inspiration:


    http://www.monitoring-softwares.com/

    ASP.NET. VB.NET: How to access value of checkbox field in the gridview control.?

    I have pulled data from SQL Server into a GridView control.


    Two of the columns are checkbox fields.





    During run-time,I am to click those columns to enter a check.


    But how can I find out if the values of those items during run-tim





    I need to allow the user to indicate whether they approve or deny a request; and then, I shall be able to update the corresponding columns in the originating database table.





    What must I do to solve this problem?





    During run-time, I added these two columns to the already existing ones:





    [code]





    Dim myCol1 As New DataColumn(';Approved';)


    Dim myCol2 As New DataColumn(';Denied';)





    myCol1.DataType = System.Type.GetType(';System.Boolean';)





    myCol2.DataType = System.Type.GetType(';System.Boolean';)





    myDataSet.Tables(0).Columns.Add(myCol1鈥?br>

    myDataSet.Tables(0).Columns.Add(myCol2鈥?br>

    myDataSet.Tables(0).AcceptChanges()


    [/code]





    I have code in myGridView_RowUpdating():





    [code]





    Try


    'For Each column As GridViewRow In myGridView.Rows(myGridView.EditIndex)


    ' Access the CheckBox


    'Dim cb As CheckBox = column.FindControl(';Approved';)





    'Perhaps could also check to see if the index of the row equals myGridView.EditIndex


    For Each row As GridViewRow In myGridView.Rows


    ' Access the CheckBox


    Dim cb As CheckBox = row.FindControl(';Approved';)








    If cb IsNot Nothing AndAlso cb.Checked Then


    Console.WriteLine(';Found';)





    'Here, I want to see if the Approved checkbox is checked.





    End If


    Next


    Catch ex As Exception


    Console.WriteLine(ex.Message)


    End Try[/code]








    This is the code that I placed in myGridView_RowCommand():





    [code]





    Static intCount As Integer


    Dim intRowIndex As Integer








    'If intCount = 0 Then


    intRowIndex = CInt(e.CommandArgument.ToString())


    'dim intColumnIndex as Integer = cint(Request.Form([';__EVENTARGUMENT';])





    myGridView.EditIndex = intRowIndex 'Place this particular row of the GridView control in edit mode.





    intCount += 1


    'End If 'If intCount = 0





    Dim intResponse As Integer


    Dim strAnswered As String








    If (e.CommandName.Equals(';Edit';)) Then





    ElseIf (e.CommandName.Equals(';Update';)) Then


    Console.WriteLine(';Update';)





    ' If myGridView.Rows(intRowIndex).Cells.Item(鈥?And myGridView.Rows(intRowIndex).Cells.Item(鈥?Then





    ' End If





    'intResponse = MsgBox(';Are you sure that you want to approve this request?';, MsgBoxStyle.YesNoCancel, ';Confirmation Required';)


    ElseIf (e.CommandName.Equals(';Cancel';)) Then





    Else


    'Nada


    End If 'If (e.CommandName.Equals(';Edit';))





    If intResponse = vbCancel Then


    MsgBox(';The record has not been changed.';, MsgBoxStyle.OkOnly, ';No Action Taken';)








    Exit Sub


    End If





    If intResponse = vbYes Then


    'Retreive the value of the key





    Dim strKey As String








    'strKey = myGridView.DataKeys(intRowIndex).Values(鈥? 'Oops! There has been nothing assigned to DataKeys.





    'Note: myGridView.Rows(intRowIndex).Cells.Item(鈥?is ';';, since it is the column of DELETE buttons.





    'This gives the contents of the first row, first column. It would have been Cells.Item(0), had it not been


    ' displaced by the row of EDIT buttons.


    strKey = myGridView.Rows(intRowIndex).Cells.Item(鈥?br>




    'Call the handling routine, with strKey as a parameter.


    'SupervisorResponse(strKey)


    End If 'If intResponse = vbYes


    [/code]ASP.NET. VB.NET: How to access value of checkbox field in the gridview control.?
    from code I have doing the same type of thing but going after a textbox





    Dim item as DataGridItem


    foreach item in DataGridCart.Items


    cartInfo = cartController.Get(CInt(DataGridCart.Dat鈥?br>

    cartInfo.Quantity = Convert.ToInt32((directcast(item.Cells(3鈥?br>

    next





    The code was converted to VB for you from CSharp on the fly...but that's the basic idea.ASP.NET. VB.NET: How to access value of checkbox field in the gridview control.?
    http://it.maconstate.edu/tutorials/

    I want to add the same event to differents controls on a form in vb.net?

    I want to add the same events to a different control. So if I had to different buttons I want them to have the same functionality but then to also display there output to 2 different textBoxs'.Example


    I want to look up the location of a file twice on the same form but then want the different values to be stored on the different places.I want to add the same event to differents controls on a form in vb.net?
    AddHandler is the way to do this. You can use AddHandler to wire the same event handler to as many different controls as you want, provided the event signature is correct.





    To do this example, add 2 buttons and 2 textboxes to the form and then paste this code in the form (assuming form is named Form1:





    Public Class Form1





    Public Sub New()





    ' This call is required by the Windows Form Designer.


    InitializeComponent()





    ' Wire both buttons to the same event handler


    AddHandler Button1.Click, AddressOf ButtonClick


    AddHandler Button2.Click, AddressOf ButtonClick





    End Sub





    Protected Sub ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs)


    Dim buttonClicked As Button = CType(sender, Button)





    Dim strMessage As String = ';Hello World! '; %26amp; buttonClicked.Name %26amp; '; was clicked!';





    Select Case buttonClicked.Name


    Case ';Button1';


    TextBox1.Text = strMessage


    Case ';Button2';


    TextBox2.Text = strMessage


    End Select





    End Sub


    End ClassI want to add the same event to differents controls on a form in vb.net?
    The AddHandler method is probably best. This technique is called 'late binding', instead of binding events at design time, you do it at runtime, usually in the Form.Load event.





    Unfortunately for VB.Net programmers, VB is pretty handicapped as the example you want to do is very easy in C#. Many of the code files (Such as Program.VB, which contains the entry point, and MyForm.Designer.vb) are hidden in the IDE, discouraging you from messing with that code. Normally you shouldn't do that if you don't know what you are doing, but several examples of design time modifications are not possible without being able to edit them.





    Note that for most events that are EventHandler delegates, or follow that pattern, send the first parameter, sender as Object, as the control where the event is fired. So a generic event to handle drag and drop for say, a given tree control, could determine which tree control invoked the event by casting this first parameter to a TreeView. In VB this is done using the CType operator.
    Try looking up the Handles option of the subroutine.





    A better solution is to create a sub with parameters that can handle both conditions. Then on each control just call the sub with the approprate parameters.
  • topical cream
  • VB.NET Returning to position of link in user control?

    I have a page that loads a user control for each record in a dataset. Each usercontrol has an 'Open/Close' link button which you can use to change the status. It updates the record in the database and does a redirect back to ther page using a Response.Redirect.





    The problem I'm having is if you scroll down to lets say the 5th item and click the link button it refreshes the page and leaves you at the top. How can I get the screen to return to the user control that has the button you just clicked.





    I think I need to use anchors somehow... but I've never worked with those before and am not sure how to use them. Someone please help! :)





    Thanks,


    - M -VB.NET Returning to position of link in user control?
    What you really need to use is AJAX, so you don't have to refresh the whole page just to change one little thing on it. There are many AJAX tutorials on the web. (AJAX is a combination of your server-side code [I'm guessing ASP or ASPX in this case] and Javascript.)VB.NET Returning to position of link in user control?
    They are called HTML anchor bookmarks and you can learn how to use them here: http://programming.top54u.com/post/HTML-鈥?/a>

    I want to connect a led to com1 or com2 and control itusing a written code by vb.net??

    if any one have an info about this,, plz??I want to connect a led to com1 or com2 and control itusing a written code by vb.net??
    All you have to do is open the port. If you connect a 1 to 2K resistor in series with an LED, you can connect the positive to the DTR (data terminal ready) pin 4 and the cathode to ground Pin 5. The LED will light when the port is opened. You can CLOSE the port, and the LED will go out. RS232 voltages can be all over the place, from 卤10V to more, so be sure not to overdrive the LED. That is the simplest way I know to make the LED go on and off without sending any data. The Port has to be set up for duplex communications (if that is an option) so the OPEN command will set the DTR bit in the UART. When the CLOSE command is run, it will reset the DTR bit, and the LED will go out. You can repeatedly open and close the port.I want to connect a led to com1 or com2 and control itusing a written code by vb.net??
    http://www.codeworks.it/net/VBNetRs232.h鈥?/a>

    How to use listbox control to retreive data into the text boxes in vb.net?

    You can use the focused Item. What is the selected item in the listbox.


    Download the 101 samples from Microsoft and you get a complete solution for that





    Helmut

    How to use listbox control to retreive data into the text boxes in vb.net?

    You can use the focused Item. What is the selected item in the listbox.


    Download the 101 samples from Microsoft and you get a complete solution for that





    Helmut

    Vb.net code to search an item in the listview control ?

    vb.netVb.net code to search an item in the listview control ?
    Try using listViewControlName.findItemWithText(Str鈥?to search)


    There are tons of examples in msdn just search for this function, it also has an option to search sub-items etc.





    cheersVb.net code to search an item in the listview control ?
    Try





    If lstview.Items.Contains(';Your Search String';) Then


    Do This


    End If





    That should search the items, not 100% sure though, no harm in trying.

    How to add control from a dll at runtime in vb.net?

    I have not tested this, but it should work.





    Create the control


    Dim btn As New Button





    Add values and a handler.


    Alternative...


    Inherits System.Windows.Forms.Button





    Dane
  • topical cream
  • Can Any One Tell me Which grid control control has textmattrix property in vb.net as in vb6.0???

    Can Any One Tell me Which grid control control has textmattrix property in vb.net as in vb6.0???Can Any One Tell me Which grid control control has textmattrix property in vb.net as in vb6.0???
    I believe the control you are looking for is the MSFlexGrid.





    MSFlexGrid.TextMatrix(SomeRow, SomeCol)Can Any One Tell me Which grid control control has textmattrix property in vb.net as in vb6.0???
    Incase you are trying to directly convert codes vb to vb.net...let me tell u..its kinda impossible. But there is a tool in ms vs.net that allows you to do converting but after that you will need to remove all the errors and warnings. You should try to look for the equivalent control..for me it would be DataGrid . In my opiniion,the properties and controls offered by vs,net controls are 85% different from vb.net. Don't waste your time looking for the same properties of controls..instead try to find the equivalent controls and learn up on how to use it.

    How would I use Vb.net to control relays with beat of the music?

    Right now i have the program set up so that check boxed come up and i can check them and doing so turns the relay on thought the parallel port. How would i set it up so that i can input a song into the program and have it play music and the program analyzes say just the tempo and turns on a specific relay when the tempo = a specific value. Thanks in advanceHow would I use Vb.net to control relays with beat of the music?
    I have worked on a few projects that sound similiar to what you are trying to do. Unfortunatly, there are no easy answer to your questions.


    The way that I used to control the parallel port was to interface the (freely available ) IO.DLL. You can download it here: http://www.geekhideout.com/iodll.shtml


    You can use the visual basic prototypes in VB.NET 2003, and 2005. I have never tried in 2008, but I assume that it will still work. Basically , you send the port a number using this dll and it will light up the binary corresponding pins on the port.





    As for the second part of the question, this is probably out of the scope that anyone is willing to try to explain in this forum. You will need to investigate the directsound methods of directx and there is a lot there to read. There is no easy way to do this.

    Saturday, January 16, 2010

    How To Add Control In Runtime Using VB.net in WPF Application?

    Hello Guys


    ==========


    I have Main Form and Student form


    ==========


    Main form has Button to open the student form with ShowDialog


    ==========


    when i open the student form it contains a minimize button








    i want to create another button in runtime but on the main form which will contain a code to maximize the studen from again ...





    i wrote that code behide the minimize button in the student form








    Dim BtnMM As New Button


    BtnMM.Height = 30


    BtnMM.Width = 80


    BtnMM.Name = ';btn_'; %26amp; Me.Title


    BtnMM.Content = Me.Title


    Dim frm As New frmMain


    frm.MainWrapp.Children.Add(BtnMM)


    frm.Show()








    the problem is now i have to main form the old 1 and the new one which contains the new runtime button





    how to solve this problem :(





    VS 2008 - WPF application - VB.netHow To Add Control In Runtime Using VB.net in WPF Application?
    You don't have to recreate the button on the main form, you already have one and it's event is to show the student form.


    You wrote:


    Main form has Button to open the student form with ShowDialog





    Why do you need a second button that does the same as the first?How To Add Control In Runtime Using VB.net in WPF Application?
    use c#.net. you can do more runtime tools with additional features

    Calendar control in C# or VB.NET?

    I'm looking for a calendar control that is as close to Outlook 2003 as possible. I'm going to use this for an internal application integrating with Exchange 2007. Any recommendations? I'm not adverse to paying for it, but it's always a bonus if it's free!Calendar control in C# or VB.NET?
    This might work??





    http://www.codeproject.com/miscctrl/CWMD鈥?/a>

    How to create array of controls in VB.Net?

    I want to create array of buttons and display them on form.How to create array of controls in VB.Net?
    Keep the name of every control sameHow to create array of controls in VB.Net?
    Here's a good article.

    Can you tell me a third-party control that's used in VB.NET?

    Can anyone tell me how this third-party control is used in an application? Can you tell me the advantages and the disadvantages of using these third-party controls in this application?Can you tell me a third-party control that's used in VB.NET?
    Disadvantage - price.





    Advantage - saves you a lot of work, and gets you something you might not have been able to write.





    It gives you the same control, form after form, project after project. (My currency box formats the numbers, has calculator-entry [entry is from the right], only allows one decimal point and only 2 digits to the right of it, fills zeros to the right of the decimal point and has a value property that's only numbers - no commas, $s, etc. The same on all my projects. It's not third-party, though - I wrote it and I use it. It's a trivial example of a custom control.)





    You use a custom control the same way you use a text box - put it on the form, set its properties, refer to its properties in the code, etc. A lot of the controls that ship with VB are custom controls that Microsoft licensed.

    Is it possible to write a firewall/parental control program in VB.NET or Java? If so, how?

    PLEASE don't suggest potential firewalls/parental control programs that I could use instead of writing one - if I wanted that, I would have asked that instead.


    Why VB.NET or Java? They're the languages I'm most familiar with.


    This is for Windows 7 Professional 64-bit, using Visual Studio 2008 (so .NET 2, 3 or 3.5), and Eclipse (using Java 6), if that makes any difference.Is it possible to write a firewall/parental control program in VB.NET or Java? If so, how?
    Yes, It is kinda possible with those programs, but it is very hard and would take Months to make, possible years, especially if your doing it on your own.


    Parental Control Programs are harder belive it or not because you have to access parts of Windows your not allowed to access.


    The Firewall however is pointless to make because Windows has one, and to make the program you need to identify ALL potential risks. This means thousands of lines of code just for identifing a risk entering the computer, then you have to tell the program where the risks will come from.


    There is just too much that you would need to do. Its pointless!!, trust me, I make programs everyday, wether its a small program like converting numbers into ASCII, Binary, Hexadecimal, or a big program such as a Custom made network controller that runs my whole Home Network of 12 computers LOL


    But really, it is just a waste of time and effort.Is it possible to write a firewall/parental control program in VB.NET or Java? If so, how?
    The easiest way to do this would be to simply write a browser based around the Internet Explorer HTML render. Just draw a webbrowser onto your form from the toolbox and add forward button, back button, navigation bar, etc.





    Make sure to delete or hide every other web browser on the computer. I'm pretty sure that deleting the Internet Explorer EXE wouldn't interfere with the operating system or disable IE based browsing in your program. (';C:\program files\internet explorer\iexplore.exe';) The actual HTML/CSS/Javascript etc. rendering is done in various DLL files - but to be safe, rename it to something else, don't delete it, in case you need to undo the change.





    Now simply catch the events for navigation and scan the text of the HTML documents.
    You can indeed, why not?





    Although it will take very long time, so I think no one is going to help you with it from start to end i afraid.





    I suggest VisualStudio 2008
  • topical cream
  • How to create a user control creation in vb.net?

    http://visualbasic.about.com/?once=true%26amp;





    http://visualbasic.about.com/od/usingvbn鈥?/a>





    ok gud luk

    Does anyone know a free or open-source IRC control / library for VB.NET ?

    Does anyone know a free or open-source IRC control / library for VB.NET ?


    Im trying to make a small IRC client in VB.NET, i tryed using winsocks but i dont know all the commandsDoes anyone know a free or open-source IRC control / library for VB.NET ?
    Well they don't have a single control for IRC because as you probably figured out that it is a whole slew of connection mechanisms, handling of ports, message routing etc. The best out there is this article for C# that can help you out for building a client in .NET if you can translate it. Plus you will need to get your hands on the IRC ';Request for comments'; or RFCs as they are also called.





    Here are some links you might find helpful in getting you on the right track. You may be able to locate some VB.NET specific source code on the net as well, but it will take a bit of looking.





    Hope you find this stuff useful.

    How to make control array in vb.net 2003?

    As far as I know, VB.NET doesn't have control arrays like classic vb6.





    I think you can simply create an array of type 'control'.





    I code in c#, so the syntax might be wrong....





    Dim myTextBoxArray As TextBox() = New TextBox() {20}





    This will give you 20 text box's; you'll need to subscribe to any events you'd be interested in, and handle the events in one handler routine.





    HTH,

    How to add our own designed Windows Controls to the VB .net solution. This is not a web application.?

    I have designed a button(*.giff). I want to add it my solution.Please Help.How to add our own designed Windows Controls to the VB .net solution. This is not a web application.?
    Hi!





    The button that you've designed is an image, not a windows forms control. You can add it to a PictureBox control, however, to achieve your desired effect:





    1. Drag and drop a PictureBox control onto your form.


    2. Resize the PictureBox to the size of your button.


    3. Click on the PictureBox and view it's properties in the properties window.


    4. Click in the ';Image'; property and then on the ';...'; button.


    5. Select the ';Project Resources File'; option and then click ';Import';.


    6. Navigate to your image in the window that appears.


    7. Click ';OK';.





    Now your button should be on your form, inside a PictureBox control. Feel free to e-mail me if you need any more help!





    I hope this helps!How to add our own designed Windows Controls to the VB .net solution. This is not a web application.?
    A gif isn't a control, it's a picture. You'll need a control to put it in. (Designing your own control means writing code.)

    Filtering data using VB.NET's DataGridView control...?

    I am using a datagridview control in my project. The user can specify up to three separate filter criteria. The program will return the search display these results into the datagridview in one run. My approach is to filter using the databindingsource.filter() method. The program performs the filters in an iterative fashion.





    Once the first filter (based upon criteria_1) is completed, the program puts the filtered results in a separate table:





    table2 = myTableAdapter.GetData


    myBindingSource.DataSource = table





    Next, the program automatically processes the second filter based upon criteria_2:





    'ComboBox.Text lists column names; TextBox.Text contains search value


    myBindingSource.Filter = String.Format(CStr(cboColumnFilter2.Text鈥?%26amp; '; = '; %26amp; CStr(txtFilterValue2.Text))





    When I run the program, I receive the following exception:





    EvaluateException was unhandled.


    Cannot perform '=' operation on System.String and System.Int32.





    ___Filtering data using VB.NET's DataGridView control...?
    If I were you, I would construct another data table to contain the results that is identical to the one you pull down. Then loop through all the rows in your actual data table, copying rows that meet the criteria to the new one. When you're done, databind the new table with filtering criteria applied to the data grid. This approach would probably perform better too.

    What's the easiest way to remotely control my VB.net program?

    OK, Suppose I want make a VB.net program that displays the number ';1'; in a textbox when a button is pressed... I can easily make that program, but what if I want it to, on my remote command, to display the number ';2'; instead when the button is pressed?





    Is it possible to write code that reads gmail messages? I know that gmail is pretty open about it's SMTP ports and stuff...





    If it is, it might be possible to, make it check a g-mail account every 10 seconds (timer), and if there is a new message in that account with the subject ';now';, then display the number ';2'; in the textbox instead when the button is pressed... Would that be the easiest way?





    If that's not the easiest way to remotely control a program, what is?





    If you didn't get my example, imagine a VB.net desktop app with a single blue button, I want the button's colour to change on my remote command from another computer...What's the easiest way to remotely control my VB.net program?
    It would probably be easier to poll some file hosted anywhere on the net. All you need is a place to host a text file.


    It's easier to read from a web server than a mail server.


    If you do go the email route, POP3 is the protocol you want. SMTP is for sending email, not receiving.What's the easiest way to remotely control my VB.net program?
    Have the program listen on a port. If a particular message comes in, do whatever it does for that message. (If the message is ';2';, display 2.)





    On the control computer, have the computer connect to the listening computer, on the port it's listening on, and send it a message.





    You can look for simple chat programs written in VB.Net as an example. (I use that in VB6 to send a message to a computer inside a network, from a computer outside the network, to check for something in the network, then signal back yes or no.)

    How to refresh the controls on a vb.net form on the go?

    I have a paint function which will dynamically pain ts the controls' surface.These sometime does not trigger.I don't know what's the exact problem is?


    Can anybody help?????????How to refresh the controls on a vb.net form on the go?
    Whichever method you use, if it doesn't trigger, it won;t work. You'll have to make sure that it triggers when you want it to. (The exact problem - as far as we can tell from here - is that wherever you're putting the trigger, it's not being executed every time you want it to be - IOW, it's in the wrong place.)How to refresh the controls on a vb.net form on the go?
    Try control.refresh().





    Make sure you are not creating an endless loop with the OnPaint event.





    Maybe this will help:


    http://visualbasic.about.com/od/usingvbnet/a/GDIP03.htm

    Needs help regarding Listview Control in VB.NET ... PLZ help Hurry ...?

    I have a ListView control in my form ... which contains 4 columns and various no of rows ...


    I've 4 textboxes on above of this list ... Now I have my list populated with some records and


    I wants to add all 4 columns of one record in textboxes .. whenever I clicks the record in listview ...


    Each time the record should be changed in the text box .. when I click the new record in ListView....





    I've tried this .. but It is not working ....








    txtZoneName.Text = lvZoneDetails.SelectedItems(0).SubItems(鈥?br>




    txtZoneServerIP.Text = lvZoneDetails.SelectedItems(0).SubItems(鈥?br>




    txtZoneServerPort.Text = lvZoneDetails.SelectedItems(0).SubItems(鈥?br>




    txtClientPort.Text = lvZoneDetails.SelectedItems(0).SubItems(鈥?br>







    using this code ... when i first click any record .. it gets populated ... but when I click another record .. It just gives error .. and form get closed ....





    Plz help me to sort out this problem . ...


    Thanks in advance ....Needs help regarding Listview Control in VB.NET ... PLZ help Hurry ...?
    The ListView object is a container for ListViewItem objects.





    When you need to read a specific item after the original list has been created you need to assign a given line in the list view to a listviewitem variable. This variable will then expose the properties of teh item such as text.





    Here is an excerpt of some of my code where I wanted to log the items shown in a list view. The technique will be similar for you, where you can use the LVI to change the text then save the updated LVI to the Listview control








    Dim lvi As ListViewItem





    max = Me.ListView1.Items.Count





    For idx = 0 To max - 1





    lvi = Me.ListView1.Items.Item(idx)


    str = lvi.Text 'extract string from list view item


    fts.WriteLine(str)


    Next

    Problem with placeholder control having webuser controls in vb.net?

    i created webuser control for insrting records into the sqltable,and placed that in placeholder control dynamically.


    when i click the create button of webusercontrol it is not inserting the record and it automatically disappering from placeholder control.....Problem with placeholder control having webuser controls in vb.net?
    I think you have to use tables for this or use the send to back option

    DateTimePicker Control in VB.NET?

    I want to pick a date from the DateTimePicker and display that date in a label.


    like...


    label1.text = datetimepicker1.value...


    but actually i want to add 5 more days to the date which i pick from DateTimePicker.


    For example if i pick 24-04-2008 ...


    lable1 shud have 29-04-2008...DateTimePicker Control in VB.NET?
    Actually you are in luck, this is very easy to do in VB.NET.





    Just use this code:


    Me.Label1.Text = Me.DateTimePicker1.Value. AddDays(5.0).ToShortDateString

    Building up a control with vb.net?

    I want to be able to do the following:


    Me.lbl_ += ctl.ID.Substring(2) + ';.text = '; + dr(';ErrMess';))


    Me.lbl_ += ctl.ID.Substring(2) - this would build up the name of the label control.


    ';.text = '; + dr(';ErrMess';)) - this would add the required text to the control.





    is there any way of buildind up a control and then adding a value to it.Building up a control with vb.net?
    It looks like your code is correct, I'm not entirely sure what you want to do or what you are doing wrong. It seems your second question concerns adding values to controls; you can inherit controls and add additional functionality to them. For example:





    public class MyTextBox inherits TextBox





    public property Value


    get


    return myValue


    end get





    set


    myValue = value


    end set





    end property





    dim myValue as String





    end class





    * If a control is part of your project, or if you add a reference to a project or assembly that contains controls, when you compile the project, you'll notice that your custom classes that represent controls are added to the toolbox. You do have to compile the project once to get them in the toolbox.





    If you need more help, you can email me, but try to be a little clearer ;)
  • topical cream
  • How can we use control arrays in VB.Net..?

    Suppose if we use Button control how can we use it..?How can we use control arrays in VB.Net..?
    Control arrays were eliminated from VB with the .net version





    The work around is to create a sub and then reference that sub in the click event for each button.How can we use control arrays in VB.Net..?
    double click on it and it will take you to the click event. You can type in the code you want to run when it is clicked durring execute.

    Treeview control in vb.net..?

    how can i link the nodes in treeview so that when u click a particular node, it will show images or textbox at the right side of the form...i have no idea pls help..tnx!Treeview control in vb.net..?
    Ok, the way I handle this is to use the tag attribute of the tree nodes. I add the object or information about the object to the node. When a node is selected, or double clicked in your situation, I recall the tag and then act upon that object.





    So, in your case you can pull out the object or image pointer and then display it.Treeview control in vb.net..?
    Depends on what you are completely trying to do.





    But I would start with using the selectednodechange event of the treeview.





    Depending on what all you are tring to display, you may want to make a class that has all the info that you need and save it in the tag of each node that is in the tree. When the node is selected use directcast to get the class out of the treenode.tag and process it.

    Where i can find outlook Menu control for vb.net windows application?

    This what you looking for?

    How i can write a vb.net code to control on\off for led connected into usb port???

    i want to control the lamp by computer??How i can write a vb.net code to control on\off for led connected into usb port???
    The .NET Framework does not support direct control of USB ports. You'll need a class that wraps the unmanaged WIN32 API to open, control, and close the ports.





    Here is some sample code to get you started:How i can write a vb.net code to control on\off for led connected into usb port???
    The link above actually looked good, i didn't download it, since i'm not at the stage to communicate with modems or network cards,





    i'm answering this to put it to the vote, vote the above answer :D





    R3dm0

    How can i add Shape control in VB.NET?

    There is no Shape control in VB.NET Tool Box. pls help me to use .NET with Line %26amp; Shape control...How can i add Shape control in VB.NET?
    http://msdn2.microsoft.com/en-us/library鈥?/a>

    How to create and handle events regarding custom custom control in vb.net application?

    I am new to asp.net. I have to write code in order to create custom control in vb.net.I want to know how to link that one custom control with that one web application.also how event are handled I want code in vb.net not in c#How to create and handle events regarding custom custom control in vb.net application?
    Perhaps this will help.





    http://samples.gotdotnet.com/quickstart/鈥?/a>





    I could be of more help in C#, but anyways. Its really simple and pretty easy.
  • topical cream
  • Third party control in vb.net desktop appication?

    Hello Friends..


    I am working on one project in VB.NET Desktop Application..


    I am not satisfied with visual studio inbuilt controls.


    For rich functionality of my application i need to


    third party controls.





    I want to know much about this third party cotrol..


    can u suggest some sites which provides free download of this


    third Party controls.





    Thanks in advance....Third party control in vb.net desktop appication?
    Perhaps you could tell us what kind of controls you need? Any more complex controls can be made yourself by creating a UserControl in your project. Also make sure the controls toolbar is fully expanded to see everything that is there.





    I personally can't think of a single control that I'd ever need that isn't in one of the standard control libraries.

    Vb.net using control key instead of ascii code.?

    this is the line that registers a hotkey based on the key in a text box.





    RegisterHotKey(Me.Handle, 6, ControlKey Or AltKey Or ShiftKey, Asc(txtApp3Key.Text.ToUpper))





    I want to replace (txtApp3Key.Text.ToUpper) with the control key. The control key does not have an ascii value so i am not sure how to do this.Vb.net using control key instead of ascii code.?
    I'm a vb.net novice, but maybe you want to use the Control.Modifierkeys property? It's a boolean value that shows whether the key is being pressed or not.





    Used as a variable, it is something like:


    Dim ControlPressed As Boolean = (Control.ModifierKeys And Keys.Control) %26lt;%26gt; 0Vb.net using control key instead of ascii code.?
    I don't believe you can register just the Control key as a hot key. The RegisterHotKey function creates a hot key which raises an event that your program can then process. You can stipulate that the Control key (or the Alt key or the Shift key, or any combination of them) be pressed along with the specified ASCII key, but not by itself.





    If you need to detect when just the Control key is pressed, use the My.Computer.Keyboard. CtrlKeyDown property (see source link below).

    Any Control in vb.net with Textmattrix property?

    Is there Any Grid Control in vb.net with Textmattrix property so that I can populate data in its cells as I wish, as I did in vb6.0, Please remember I want to do it in .netAny Control in vb.net with Textmattrix property?
    MsFlexGrid provides the TextMatrix Property





    If there r other controls u can always search on MSDN

    VB.NET 2005 Control?

    What is the name of the control that allows you to collapse and expand a section of output. Just like the ones in Facebook where you click on the title and then the contents appear (or disappear) below?VB.NET 2005 Control?
    it's called ';collapsible panel'; and is party of AJAX package that is available from Microsoft for FREE!!!





    here's the link to the sample demo:


    http://asp.net/AJAX/AjaxControlToolkit/S鈥?/a>





    here's the link to the video tutorial:


    http://www.asp.net/learn/ajax-videos/vid鈥?/a>





    and here's the link to install AJAX, so you can start using this feature on your website.:


    http://www.codeplex.com/AtlasControlTool鈥?/a>








    i have it on my website and really love it!! good luck!!VB.NET 2005 Control?
    CollapsiblePanel is one of the controls, I think the one you are looking for is the AccordionPane, which provides a number of sections, only 1 of which can be active at any point in time. It is essentially a collection of collapsible panels. Requires Asp.Net Ajax extensions and the AjaxControlToolkit. The toolkit samples should show you everything you need to get up and running with these cool UI controls.

    How can we program the tabbed control in VB.Net.I mean how can we code tab selections and so.Thanks in advance

    Use the Tab Control in System.Windows.Forms.TabControl

    Auto fill a textbox in vb.net webbrowser control with element id?

    auto fill with what? You can assign a value to go into the textbox at design time.
  • topical cream
  • Listview multiline control vb.net?

    I'm doing a program in VB.NET Windows Form.


    How to create a listview that support multiline for the row??


    I want the column height to auto adjust base on the contains of the column (wordwrap)Listview multiline control vb.net?
    Join this company and make more money than you thought possible. Check it out. What do you have to loose? Nothing ... But you have everything to gain. Realize, this is a legitimate business with no spam involved. Join the new wave of advertising for the latest and greatest invention of the internet, the .ws domains!





    http://website.ws/whudgins

    Can any one help me in adding event handlers dynamically to a dynamically created control in VB.net?

    i am developing a custom calendar which creates panels as per the days in month dynamically through the program.when i click on any of the panel that is created at runtime it should return the corresponding date it is showing.the date is shown by a label(that too created dynamically) inside that panel.Can anyone help me out with this problem please.Can any one help me in adding event handlers dynamically to a dynamically created control in VB.net?
    Here you go babe!!

    Whats the best 3rd party VB.NET Grid control for hosting comboboxes & other controls with report generation?

    I need a simple VB.NET Grid without too many complex features. Basically the grid should be able to host comboboxes, textboxes, checkboxes, radio buttons %26amp; datetime controls.





    It should have WYSIWYG printing capability with options to suppress or print borders, gridlines, etc. It should support cell-merging, individual formatting for different cells, non-editable cells, etc.





    The grid should raise events when the user moves to a different row or column, and that event must be cancellable. It should also raise events when the user starts editing a cell and when the user has finished editing. I must be able to restrict input in any way.





    The look and feel of the grid must be customizable. It should be a free-form grid (like VB6 FlexGrid), not a data-bound grid.





    There should be an option to start cell-editing on the first keypress, or when the user presses a particular key like F2. Moreover, I should be able to trap the press of ANY key so that I can customize its functionality.Whats the best 3rd party VB.NET Grid control for hosting comboboxes %26amp; other controls with report generation?
    We use the infragistics package. Their stuff is very visual, so they have tons of ways you can change the appearance of the controls. A bit cludgy to learn their objects, but ok. If the default microsoft stuff is a D+, then I give Infragistics a B-

    How to fill data in MS Office chart control 10 in VB .NET?

    I have created a chart in VB .NET using MS Chart control 10. I can fill information manually, that no problem and the chart works wonderful. The problem now comes when I want to fill data through a code. How do I do that? Your help guys will be highly appreciated.How to fill data in MS Office chart control 10 in VB .NET?
    You going to have to set a reference to MS Chart Control 10 and the drag the control onto the form and rename the control to chart1:








    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


    System.EventArgs) Handles MyBase.Load





    Dim arrData(3, 3) As Object





    arrData(1, 1) = ';Jan'; ' Set the labels in the first series.





    arrData(2, 1) = ';Feb';





    arrData(3, 1) = ';Mar';





    arrData(1, 2) = 8





    arrData(2, 2) = 4





    arrData(3, 2) = 0.3





    arrData(1, 3) = 0.2





    arrData(2, 3) = 3





    arrData(3, 3) = 6.3





    Chart1.ChartData = arrData





    End Sub

    Is there any way to change the color of the tabs on a tab control - VB.net?

    im just trying to change the color to black, but apparently microsoft didn't want to help the user out hereIs there any way to change the color of the tabs on a tab control - VB.net?
    If you want the entire tabpage to change color then:





    Me.TabPage1.BackColor = Color.Blue





    Searched on MSDN for you, got some nice examples here, try them out and let me know if they work for you:





    http://forums.msdn.microsoft.com/en-US/v鈥?/a>





    http://forums.microsoft.com/MSDN/ShowPos鈥?/a>

    How can we navigate from one tab page to another tab page in tab control on button click (vb.net)?

    %26lt;tab control name%26gt;.selectedtab = %26lt;tab page control name%26gt;





    my tab control is called tabcontrol1


    it contains two tabpages called tabpage1 and tabpage2





    I click a butto and I want it to switch from tabpage1 to tabpage2 like this:





    TabControl1.SelectedTab = Me.TabPage2
  • topical cream
  • Can a user control in vb.net control an control on the parent page?

    I have an application and I have finally found a need to create some user controls since it looks like some of the forms will build off of one another. Eventually, I will have a parent page which may have just one submit button which will stay on the parent page. I have a case where I need to disable the submit


    button but I haven't found out how to reference the button on the control's code behind so I can disable it. Is it possible for a user control to reference controls on the parent page.Can a user control in vb.net control an control on the parent page?
    Here's a good article on how to do this:





    http://aspnet.4guysfromrolla.com/article鈥?/a>

    Is there a VB .NET control like this?

    its like the buttons in outlook on the lower left.. mail, calendar,contacts. its kinda like a tab control.Is there a VB .NET control like this?
    It is called the Accordian Control. It is an AJAX toolkit control.


    See: http://www.asp.net/AJAX/AjaxControlToolk鈥?/a>Is there a VB .NET control like this?
    Could construct one in vb.net by using some pictures adjacent to some regular buttons.





    use onclick to change the shading of the control and turn off shading in unselected controls + whatever actions you need. such as flipping through panels on the panel control.

    In VB.net (Visual Studio 2005), how can I get dynamically get the Top property of the last control in a panel?

    I am generating a group of radio buttons. I want to get the Top value of the last generated radio button so I can generate a group of check boxes underneath it. My aim is to allow a questionnaire creator to dynamically create questions of type (multiple choice, free entry, etc).Thanks in advanceIn VB.net (Visual Studio 2005), how can I get dynamically get the Top property of the last control in a panel?
    radioButtons[radioButtons.Length].Top

    In VB.Net - How do I offer the ability for user to change the font of any individual control?

    I can place the Font Dialog on the form. But in runtime the whole form is changed when this is called. How do I allow the user to choose which button, textbox, etc they want to change?In VB.Net - How do I offer the ability for user to change the font of any individual control?
    You can click the button and have the font change on that. Or you can compare the control that you want with that one the page and change the font that way. Example;


    If CType(lblTime, Label).Text = ';One'; Then


    ...


    End If





    But you will have to put that through a loop...





    EXAMPLE:THIS IS TO LOOP THROUGH BUTTONS





    Private Sub btnListAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnListAll.Click


    On Error Resume Next


    'Looping through all the buttons using this code





    'For Each GetButton as Control in Me.Controls


    'If TypeOf GetButton Is Button then


    'txtGetTest.Text %26amp;= GetButton.text %26amp; vbCrLf


    'End If


    'Next





    'The problem is the code will NOT see the


    'controls in the GroupBox's





    'Reset the counter


    m_ControlCount = 0


    'Clear the textbox


    txtGetText.Clear()


    'Goto the user create sub


    'Get the objects in Me( form )


    ShowAll(Me)





    'If code said ';ShowAll(Me.GroupBox1)';


    'The oaContainer would return all the


    'controls in the Groupbox ONLY





    End Sub


    Sub ShowAll(ByVal oaContainer As Control)


    On Error Resume Next


    'Get all the controls in the control area specified (Me)


    For Each cntrl As Control In oaContainer.Controls


    'If the current control in a button and


    'the control is not blank then


    If TypeOf cntrl Is Button AndAlso _


    Not (cntrl.Text = Nothing) Then


    'Add one(1) to the counter


    m_ControlCount += 1


    'Add counter and the


    'control name to the nextbox


    'START a new line


    txtGetText.Text %26amp;= _


    m_ControlCount %26amp; ';) '; %26amp; cntrl.Text %26amp; vbCrLf





    End If


    'Input this to show ALL the controls


    'on the form


    ShowAll(cntrl)


    'Refresh the control


    'IF Refresh() is NOT implemented


    'Error will occur when user presses another button


    cntrl.Refresh()


    Next





    End Sub

    How can you make a dynamic control in VB.net invisible after displaying it once ?

    i am creating 10 panels inside a for loop. when i call this loop again i need the panels made before tobe gone or invisible and a new set of panels should be visible to the user. Can anyone help with me?How can you make a dynamic control in VB.net invisible after displaying it once ?
    Try this:





    Dim bShowControls As Boolean = True





    Private Sub ShowControls()


    Dim i As Integer





    For i = 0 to 9


    myControls(i).Visible = bShowControls


    Next


    bShowControls = False








    End Sub





    Since bShowControls is a module level variable, its state will persist and your controls will be shown once. If your code is inside a class then delcare and initialize bShowControls inside the class.

    How to lock & unlock the Richtextbox control in VB.NET?

    Thr is only way to lock %26amp; unlock the richtextbox by property window. but i hav to lock %26amp; unlock it during runtime.How to lock %26amp; unlock the Richtextbox control in VB.NET?
    These are the properties for TextBox





    Enabled: Default value is True. To disable, set the property to False.


    Multiline: Setting this property to True makes the TextBox multiline which allows to accept multiple lines of text. Default value is False.


    PasswordChar: Used to set the password character. The text displayed in the TextBox will be the character set by the user. Say, if you enter *, the text that is entered in the TextBox is displayed as *.


    ReadOnly: Makes this TextBox readonly. It doesn't allow to enter any text.


    Visible: Default value is True. To hide it set the property to False.
  • topical cream
  • What is the importance of using standard VB.NET control naming conventions.?

    It makes the code easy to read - you can tell exactly what kind of object the code is talking about, and it makes it simple ot follow the flow of the code.What is the importance of using standard VB.NET control naming conventions.?
    Using standard naming conventions in your code make it easier for other programmers to read and understand your code.

    In VB .net Gridview control how can I add funtionality to the predefined Select button.?

    For example as soon as the row is selected using the button I would like to run some logic. So basically I would like to append the code that runs behind the button.In VB .net Gridview control how can I add funtionality to the predefined Select button.?
    Just trap the SelectedIndexChanged event and add your code there. (I'm using C# but I assume that handler exists in VB as well).

    How can i add Flexgrid control to VB.NET project?

    Hi, Im use Visual studio 2005 and i need to add flexgrid control to my form in vb.net. please help me to do this....How can i add Flexgrid control to VB.NET project?
    Hi! Just drag the flexgrid control from the toolbox onto your form.

    How do I bind a listbox with a datagid control in VB.Net and ADO.Net they both already have a data source?

    A control can be bound to only one source. You need to rethink what you think you want, versus what you really want.