I am new to Visual Basic and trying to get around in developing a good gui for a chat interface. I can understand the language as i have been using php and java from quite sometime.
Requirement
Basically i am trying to develop a interface which will show a list of users and along with that display a status (online/offline). My users will reside in mysql database. On clicking the user i want some actions to happen.
Question
I see there is datagrid, listview,listbox but not sure which one to use. Also is it a good idea to display the users by directly quering the mysql database or by accessing a php script which runs few queries and gives the data?
The ListBox control would not be a great option since it doesn't easily support multiple columns. The ListView control in Details view is a great option. I think it looks and works nicer than a DataGrid, but it doesn't natively support multi-line items. If you need multi-line items, the DataGrid control may be your best choice. Another option, which would give you more flexibility, would be to use a LayoutPanel control to display a vertical list of your own UserControl. You could design the UserControl anyway you want meaning you could fully control the size, look, and layout of each item in the list without being constrained by the list control.
As far as getting the data, that depends. If the database is always on the LAN and performance is important, then each client should go directly to the database. Otherwise, getting the data from a php script, web service, or WCF service would be a much better choice.
Rather than using the TableLayoutPanel, I would recommend using the FlowLayoutPanel with the FlowDirection property to TopDown and the AutoScroll property set to True. Then, to add a control dynamically, you could do something like this:
Dim item As New MyUserControl()
' Set properties of user control
FlowLayouPanel1.Controls.Add(item)
Related
Like many, I'm trying to build a wizard like presentation.
I've created a Windows Form as the host for a series of "WizPanel"s that have been designed as User Control Forms. Each of them may/will have unique data connections and layouts. My intended implementation creates a Collection(of UserControl). I'm at the design point that I want to load the collection with a set of panels that best describe the process flow required by the current use case.
The problem I'm running into is how to be able to load a New UCDataReview (user control form), a New UCDataParameters (user control form), then the rest of the panels as required. I don't want the panels to load data at this point as some of the data queries may never be required - based on data supplied in previous panels (possibly, just design at this point). I just want to make sure data only loads when I specify. I like to have a function ShowData() on each of the panels and then execute it from within the main Wizard form (after the next button is clicked - it wouldn't be needed on a back as it should be there already).
So, I'm stuck on the concept of crating a 'base wizard panel' control (WizPanelBase) that has a ShowData() function that is empty in the base control form but can be overridden in the class (WizPanel) that the panel is based upon. I'd then have a Collection(of WizPanelBase) that would then allow me to issue a ShowData() call.
I'm sorry for not using the correct verbiage as I'm only a part timer and just playing to learn. I've done this with an Object Class (ObjBase_Person; ObjBase_Vehicle ...) and then extended them into Person_Student, Person_Instructor, Vehicle_Car, Vehicle_Truck etc). I'm quite sure I can, I just know enough to be dangerous, but I don't know what to even ask for to find tutorials. The similar questions here are generally about using a User Control on a Windows form.
To illustrate what I'm asking, let's say I have a custom TextBox that has 2 modes. Mode 1 only allows numbers, and mode 2 only allows dates in a particular format.
Using a class module I can create this custom TextBox, and I can use a loop when the userform initialises to set which TextBoxes are custom.
What I'd like to happen is have the custom TextBox, or what ever custom control I want, show up in the toolbox. And I also want its custom properties, if they exist, to show up in the property window.
So far, I've been unable to find a way to do this. In fact, I've been unable to find out if it's even possible. It seems, to me anyway, that it's something that should be possible, but maybe I'm barking up the wrong tree. If it's possible I'd really appreciate being pointed to a resource.
new to .net coming from vba decided to rewrite a management app using vb.net and SQL Server.
Started writing the base library for my application.
I created custom controls to use in my application that would expose a Zoom function, background color for the current active control a .modified property similar to the one available in textbox and some extra other properties (SQLTableName, SQLColumnName, ...) to enable iterating through a container (form) for modified controls and Update/Insert into a SQL table via a SQLProcessClass.
Concurrently I'd like to also implement a simple undo functionality.
My first idea was to add a PrevValue variable set in the OnEnter event if the Modified property is False, exposing an OldValue property and an Undo method in the custom controls.
However I found that the TextBoxBaseClass already exposes an Undo method and that there is an UndoEngineClass available.
Unfortunately the vs helpfile does not give examples of how to use / implement that class.
Could someone explain the usage of the UndoEngine class non-textbox controls and if it is advisable to use it or rather write my own (as I first intended to do - I also found some interesting articles about undo/redo classes) but why reinvent the wheel in case .net already provides a class for it.
thks
I am trying to broaden my knowledge of user controls or to be more specific, composite user controls. Msdn has a walkthrough on the subject here which although not in VB is easy enough to follow and get results.
What I had had in mind was to create a base user control comprised of a split panel, one half of which would be used to display dynamic help and the other half which could house whatever controls the new user control which would inherit from this required. The problem that I am facing is that when I then create a new inherited control based upon my base control I cannot add new controls to the design surface. If I don't have a split panel filling the entire design surface of the base control I can add new controls, but if I do I can't.
Either I am doing something wrong, or more likely failing to do something on the base control that I ought to do , or this can't be done which I find odd to believe. I'm hoping someone can explain what it is I've missed.
This is being targeted at winforms with vb.
Thanks
Well, Did you make the split panel's modifier to protected or protected internal or public? That should do the trick.
By default it is private and so designer will prevent you from accessing it.
I was wondering if anyone knows what a simplest way to create a data entry form in Sharepoint 2010 Foundation would be. Basicly I am looking to create a form that will submit its data to a custom list on the site, I don't want the users to interact with the list directly but use the form to enter data instead.
Also I can't use Designer or InfoPath, not being able to use these is what is causing the problem it seems. Just curious if anyone else has done something like this or could point me in the right direction.
Thanks
Every list is born with forms by default - one for item creation, one for edition and one for displaying. If you use content types, then you get a trio of these for each different type.
You never interact with the list directly, you do it through these forms. If you can't use either Infopath nor Sharepoint Designer, you can still edit them by clicking on the Page tab, then the Edit Page button. From there you can add or remove web parts, and connect them among themselves.
However, the amount of control you have is too limited when compared to editing pages through either of the tools or mentioned, or Visual Studio. For example, there is no straightforward way to add or remove list fields based on content type. Be prepared for ever increasing frustration if you can't use those tools.