|
You have to create the controls, like I preseume you already did, and add them to the Form's Controls collection. After that, you have to write your event handlers using Sub's with the same signature as the event you want to handle (see the documentation for each event), then manually wire up the events using AddHandler[^]. Don't forget to disconnect the events handlers using RemoveHandler if you need to destroy the controls later.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have Exchange setup on a server and I am trying to write an ASP.NET application that saves some form data to a database, and then sends a notification email to a 3rd party.
I used the code, pretty much verbatim from here Support @ Microsoft[^]
I added the Office11 COM object as a reference; however, on the line oApp = New Outlook.Application() I get a weird error saying that the
ASP.NET is not authorized to access the requested resource
Any ideas on how to resolve this?
Jason
|
|
|
|
|
Hi.
I am new to this site. I found an example of an image combobox by Alon Ronen. The code is as follows:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim items(Me.ImageList1.Images.Count - 1) As String
For i As Int32 = 0 To Me.ImageList1.Images.Count - 1
items(i) = "Item " & i.ToString
Next
Me.ComboBox1.Items.AddRange(items)
Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
Me.ComboBox1.DrawMode = DrawMode.OwnerDrawVariable
Me.ComboBox1.ItemHeight = Me.ImageList1.ImageSize.Height
Me.ComboBox1.Width = Me.ImageList1.ImageSize.Width + 200
Me.ComboBox1.MaxDropDownItems = Me.ImageList1.Images.Count
End Sub
Private Sub ComboBox1_DrawItem(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DrawItemEventArgs) _
Handles ComboBox1.DrawItem
If e.Index <> -1 Then
e.Graphics.DrawImage(Me.ImageList1.Images(e.Index), _
e.Bounds.Left, e.Bounds.Top)
End If
End Sub
Private Sub ComboBox1_MeasureItem(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MeasureItemEventArgs) _
Handles ComboBox1.MeasureItem
e.ItemHeight = Me.ImageList1.ImageSize.Height
e.ItemWidth = Me.ImageList1.ImageSize.Width
End Sub
I would ask the author about this code but I cannot figure out how to contact the author. My question is how I would add text to this combobox. I want a box with images and a line of text as a kind of descriptor. Any ideas?
|
|
|
|
|
You can contact the author by going to the bottom of his article and posting a New Message. Each article gets it's own forum for discussing the article.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, I am new to .Net and working with threads for the first time. Please review the code below.
Dim t As Thread
t = New Thread(AddressOf Me.GetValue) ' GetValue is a procedure
t.Start()
In GetValue, I want to get some data from the DB and fill in a combobox. However, when the following code in GetValue executes -
str = "select ID from ABC"
DA = New OleDbDataAdapter(str, ipcon)
DS = New DataSet
DA.Fill(DS, "rec")
- the control is lost. i.e: the next set of statements (to fill the combobox with the dataset values) do not execute. I am not sure why such a thing is happening. Is there some way to handle this threading issue that I am missing? Please help.
With Best Regards,
Mayur
|
|
|
|
|
Try Instantiating the Datatable on the main thread before you start the second thread:
<br />
Dim dt As New DataTable("dt")<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim thrFillTable As New Threading.Thread(AddressOf FillTable)<br />
thrFillTable.Start()<br />
End Sub<br />
<br />
Private Sub FillTable()<br />
Dim c1 As New DataColumn("Number")<br />
dt.Columns.Add(c1)<br />
Dim dr As DataRow<br />
For i As Integer = 0 To 10<br />
dr = dt.NewRow<br />
dr.Item(0) = i.ToString<br />
dt.Rows.Add(dr)<br />
'Next line is just to waste time <br />
'so you will see combo has no data <br />
'till thread Is finished<br />
Threading.Thread.Sleep(2000)<br />
Next<br />
Me.ComboBox1.DataSource = dt<br />
Me.ComboBox1.DisplayMember = "Number"<br />
End Sub<br />
<br />
<br />
|
|
|
|
|
i was using this code to play my background music but when i play the sound effect, the previous music was stop anyone know how to overlap the audio? by continue playing the background music
:
=BGmusic
Me.AxWindowsMediaPlayer1.URL = Path.GetDirectoryName(Application.ExecutablePath) & "\sound\start.mp3"
=Soundeffect
Me.AxWindowsMediaPlayer1.URL = Path.GetDirectoryName(Application.ExecutablePath) & "\sound\step.mp3"
Or is there any other method to play 2 audio together?
-- modified at 6:45 Tuesday 7th March, 2006
|
|
|
|
|
|
ya thats y wanna know anyone have other device cause i only know use the mediaplayer... u have any clue?
|
|
|
|
|
Media Player will only play one thing at a time, so you'll have to use a library that can do mroe than that, like DirectX and it's DirectSound library.
Sorry, I don't have any examples because that's no my area of expertise or development work. Google should be able to get you hundreds of examples though.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yes i was trying to do that , now i try using the directx and mediaplayer but seem like the problem still there...
actually have u seen anyone done it b4? or is it VB.NET cant handle that kind of function?
|
|
|
|
|
rompnet wrote: actually have u seen anyone done it b4
In every DirectX game I've every played... And without using MediaPlayer.
It's not a problem with VB.NET. It's a problem with the audio library your using. Perhaps searching for DirectSound examples might help?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i see , thanks will try searching for it
|
|
|
|
|
oh there is one thing i want to ask also the directx able to play mp3?? i using the mediaPlayer to play the mp3...casue i think using the API method cannot play mp3 only wav and midi.... is it true?
|
|
|
|
|
I have no idea. DirectX isn't my area of expertise.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I also need a help with that.
I need the create a background sound and a sound for the game I am developing.
So far I can only import the DirectX libraries and that is it.
I know I have do create a directX device and full stop. And How?
Help is very much appreciated.
|
|
|
|
|
First, you're replying to posts that are VERY old.
Second, read my post again - I'm not an expert in DirectX at all. I have not idea how to do this.
|
|
|
|
|
When i type the "<" the combobox with items is visible buth it always on same position.
Is there anny way to set it on position where i typet the "<" in text box? :->
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 60 Then '60 is Ascii value of <
Combo1.Visible = True
Combo1.Left = 500
End If
End Sub
|
|
|
|
|
have u smokeing something?
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
No, but apparently you have. The answer he gave you is a little sparse, but essentially correct.
You can position the ComboBox anywhere on the form using its Left and Top properties, or both at once using its Location property.
If the ComboBox is behind another control, you can bring it to the top by calling its BringToFront method. You might also have to set its Visible property to True you already have this ComboBox on the form and are hiding it.
If not, you'll have to create the ComboBox dynamically, you can, but you also have to add it to the form's Controls collection and wire up any events that you want to handle by hand, using AddHandler and RemoveHandler .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
omfg i am not noob... lol
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
FeRtoll wrote: omfg i am not noob... lol
Well you act like it.
...Steve
quod erat demonstrandum
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Like Steve said, you're acting like one.
On top of that, you're asking questions on the level of one too. Maybe if you included a bit more detail about exactly what you're having a problem with, you wouldn't get the "shotgun" answer that covers all the basics.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Steve Sorry...
The problem is that i am from croatia and its hard to me to explain it on english wery good... I am trying buth its not easy...
Well...
My problem is that i want that the listbox shows when i press key"<" buth i want that it shows on the possition where was i typing where was the cursor buth not the mouse cursor, typing cursor(IBeam).
I did make it like this...
When key "<" is pressed if
listbox1.visible=true then<br />
listbox1.visible=false <br />
elseif listbox1.visible=false then<br />
listbox1.visible=true
buth the problem is that it is allways on possition where i place it in design.
i want that his possition is where i have typing... Like in dreamweaver when u typing tags...
Did i explain it good now?
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|