This topic describes how to create a basic Visual Basic Windows Forms application in Visual Studio.
Do the following:
Create a label (label1) to display the version of the Qlik associative engine.
- Select Solution Explorer > Form1.vb > View Designer to open the Form1.cs [Design] page.
- Create a labelToolbox > Common controls > Label.
- Place the label on the Form1 component.
Create an event handler for the load event of the form.
- Open the Properties panel for the Form1 object and click on the Events button.
- Double click on Load to add an event. The event (Form1_Load) is added and the code page is displayed.
Create a connection to the engine by adding a imports clause for Qlik.Engine in the Form1.vb file.Note: This example assumes that the engine is running locally because the hub is retrieved from Qlik.Engine.Location.FromUri.
Then call QTProduct as a synchronous call to retrieve the engine edition from Qlik associative engine and update the label.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim loc = Qlik.Engine.Location.FromUri(New Uri("ws://127.0.0.1:4848")) loc.AsDirectConnectionToPersonalEdition() Using hub As IHub = loc.Hub Label1.Text = hub.QTProduct End Using End Sub
Run the program.
- Select Debug > Start Debugging.
- Ensure there is a compatible Qlik associative engine running. The Qlik engine edition is displayed.
You have now created a basic Visual Basic Windows Form application.