Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Couple of VB.Net questions


Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2005, 11:51 PM
aliweb's Avatar
aliweb aliweb is offline
Centurion
 
Join Date: Jan 2004
Posts: 146
Question Couple of VB.Net questions


Q1. How can I make a button default in VB.Net? In Vb6 there is a property named Default for command button which you can use but I can't find it in VB.Net.

Q2. How can I use/create/make this dock able Outlook style menu in VB.Net? (see 1.jpg and 2.jpg). The menu I am talking about is the one in which there are Employees, Jobs and Parameters buttons.
Attached Images
File Type: jpg 1.JPG (42.6 KB, 10 views)
File Type: jpg 2.JPG (38.5 KB, 15 views)
Reply With Quote
  #2  
Old 08-26-2005, 12:04 AM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

Q1. The control with a Tab Index of 0 is the default.

Q2. Yeah, it can be tricky to make nice custom controls like that. If you want something similar quickly, I would suggest using a ListView, with the View property set to large icon. Then specify an image list for images, etc. You wont get the same effect though, but it will be pretty good I think.

In terms of the docking, if you want people to drag your ListView around and dock it, you will have to write your own code. In this case I would create my own custom control, and have the ListView on the custom control, and all the dragging code with respect to the custom control, not the listview. That way you can have picture boxes on the custom control for the little close button and stuff like that. Still, it's a fair amount of work ahead of you if that's what you are after.

Have you looked for a custom control on the net somewhere?
Reply With Quote
  #3  
Old 08-26-2005, 12:19 AM
aliweb's Avatar
aliweb aliweb is offline
Centurion
 
Join Date: Jan 2004
Posts: 146
Default

Q1. I don't think it would work that way. Because the first control I have on my form is a text box which should have the focus first so its TabIndex i s0. The OK button which I want to be a default one is at number 10. So if I make this button's TabIndex 0 then the focus will shift to it when the form loads. Plus it will also mess up the order of TabIndex.

Q2. I will look into it.


Another question.

Q3. In the right pane in both the pics you will find two objects/icons J WILLIAMS and R COLLINS. How can I use like these one in my VB.Net application?
Reply With Quote
  #4  
Old 08-26-2005, 12:31 AM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

Q1. For that form, you can set the 'Accept Button' as a property. You can also set a 'Cancel Button' for when the user presses escape, etc.

That right pane is definitely a straight up ListView in large icon mode.
Reply With Quote
  #5  
Old 08-26-2005, 12:31 AM
aliweb's Avatar
aliweb aliweb is offline
Centurion
 
Join Date: Jan 2004
Posts: 146
Default

Ok I found the answer to Q2
http://vbaccelerator.com/home/NET/Co...ar/article.asp

But is it not dockable.
Reply With Quote
  #6  
Old 08-26-2005, 12:32 AM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

Nice one. Nice control, I will find somewhere to use that
Reply With Quote
  #7  
Old 08-26-2005, 12:48 AM
aliweb's Avatar
aliweb aliweb is offline
Centurion
 
Join Date: Jan 2004
Posts: 146
Default

Quote:
Originally Posted by sgt_pinky
Q1. For that form, you can set the 'Accept Button' as a property. You can also set a 'Cancel Button' for when the user presses escape, etc.

That right pane is definitely a straight up ListView in large icon mode.
Oh yes this is it. It is the Accept Button property in form.
Reply With Quote
  #8  
Old 08-26-2005, 02:25 AM
aliweb's Avatar
aliweb aliweb is offline
Centurion
 
Join Date: Jan 2004
Posts: 146
Default

Q4. How can I use any 3rd party component that I have added in my Vb.Net project? For example if I download a control named XPStyleMenu and add its reference by right clicking on the project and then Add Reference. But it doesn't show up in the Windows Forms tab on left side where there is a list of all built in controls like Button, Label, TextBox e.t.c. How can I add the control on my form/
In VB6 when you add a new component then it automatically shows up in the Toolbar which is on left side.
Reply With Quote
  #9  
Old 08-26-2005, 04:17 AM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

Yeah, usually custom controls come up in the Toolbox panel under Windows Forms. If it's not there, you can always add them manually by right clicking on the toolbar and selecting "Add/Remove Items..." and browse to the class library. Or you can add the control at runtime. To do this click on the new reference in your Solution Explorer (accListBar), and press F2 to see the object explorer for that item - then you can see the Namespace etc that the control resides under.

Then you could do something like this in the Form_Load() sub:

Code:
Dim xx As New vbAccelerator.Components.ListBarControl.ListBar xx.Dock = DockStyle.Left Me.Controls.Add(xx)

You can do this with every control. eg:

Code:
Dim xx as New Button xx.Text="Click me!" Me.Controls.Add(xx)

Another good idea is to download the sample on that webpage: Sample for ListBar here
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->