PC Review


Reply
Thread Tools Rate Thread

custom control: combobox + timer

 
 
Bernie Yaeger
Guest
Posts: n/a
 
      16th Nov 2004
I'm trying to create a custom control that contains both a combobox and a
timer. Any ideas how I can accomplish this? I do know how to create a 'one
control' inheritance control, but when I add the timer, it compiles but I
don't get its functionality - and it's not ticking, as I want it to.

Thanks for any help.

Bernie Yaeger


 
Reply With Quote
 
 
 
 
Scott Swigart
Guest
Posts: n/a
 
      16th Nov 2004
Do "File | New | Project"
Select "Windows Control Library"

You'll get a control surface that looks like a form, minus the border. Put
any controls you want on this, including a ComboBox and Timer.

Also, if you really just want to inherit ComboBox with your control, then
you can create the timer programmatically:

Protected tick As New Timer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
tick.Enabled = True
tick.Interval = 1000
AddHandler tick.Tick, AddressOf Timer_Tick
End Sub

Public Sub Timer_Tick(ByVal sender As Object, ByVal e As EventArgs)
Debug.WriteLine("Tick, Tock")
End Sub

- Scott Swigart


"Bernie Yaeger" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm trying to create a custom control that contains both a combobox and a
> timer. Any ideas how I can accomplish this? I do know how to create a
> 'one control' inheritance control, but when I add the timer, it compiles
> but I don't get its functionality - and it's not ticking, as I want it to.
>
> Thanks for any help.
>
> Bernie Yaeger
>



 
Reply With Quote
 
Bernie Yaeger
Guest
Posts: n/a
 
      16th Nov 2004
Hi Scott,

Thanks for your help. I already got the timer to work in it, quite similar
to your approach.

Tx again,

Bernie

"Scott Swigart" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Do "File | New | Project"
> Select "Windows Control Library"
>
> You'll get a control surface that looks like a form, minus the border.
> Put any controls you want on this, including a ComboBox and Timer.
>
> Also, if you really just want to inherit ComboBox with your control, then
> you can create the timer programmatically:
>
> Protected tick As New Timer
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> tick.Enabled = True
> tick.Interval = 1000
> AddHandler tick.Tick, AddressOf Timer_Tick
> End Sub
>
> Public Sub Timer_Tick(ByVal sender As Object, ByVal e As EventArgs)
> Debug.WriteLine("Tick, Tock")
> End Sub
>
> - Scott Swigart
>
>
> "Bernie Yaeger" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I'm trying to create a custom control that contains both a combobox and a
>> timer. Any ideas how I can accomplish this? I do know how to create a
>> 'one control' inheritance control, but when I add the timer, it compiles
>> but I don't get its functionality - and it's not ticking, as I want it
>> to.
>>
>> Thanks for any help.
>>
>> Bernie Yaeger
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help creating custom ComboBox control mongphong28@yahoo.com.au Microsoft VB .NET 8 6th Mar 2006 07:03 AM
Having trouble with custom combobox control =?Utf-8?B?RmxhY2s=?= Microsoft C# .NET 3 25th May 2005 05:26 PM
custom control: combobox + timer Bernie Yaeger Microsoft Dot NET Framework Forms 2 16th Nov 2004 01:40 PM
Re: Timer on Custom Control Does Not Work Chris Tacke, eMVP Microsoft Dot NET Compact Framework 4 10th Jun 2004 09:02 PM
ComboBox custom control Brad Sanders Microsoft VB .NET 1 3rd Nov 2003 02:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:55 AM.