473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

From C to VB

Hello.

Do you know how to convert this code to VB.NET?

Thank you.

http://msdn.microsoft.com/es-es/library/bb613590.aspx
Aug 7 '08 #1
3 1166
On Aug 7, 2:31*pm, Kulber <Kul...@discussions.microsoft.comwrote:
Hello.

Do you know how to convert this code to VB.NET?

Thank you.

http://msdn.microsoft.com/es-es/library/bb613590.aspx
It's not that complicated of code, take your time and read through it
and you should be able to figure it out.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Aug 7 '08 #2
Imports System
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Controls
Imports System.Windows.Media
Imports System.Windows.Media.Imaging

Namespace SDKSample
Partial Public Class TextBoxBackgroundExample
Inherits Page

Private Sub OnTextBoxTextChanged(ByVal sender As Object, ByVal e As
TextChangedEventArgs)

If myTextBox.Text = "" Then
' Create an ImageBrush.
Dim textImageBrush As New ImageBrush()
textImageBrush.ImageSource = New BitmapImage(New
Uri("TextBoxBackground.gif", UriKind.Relative))
textImageBrush.AlignmentX = AlignmentX.Left
textImageBrush.Stretch = Stretch.None
' Use the brush to paint the button's background.
myTextBox.Background = textImageBrush

Else

myTextBox.Background = Nothing
End If

End Sub

End Class

End Namespace

"Kulber" <Ku****@discussions.microsoft.comwrote in message
news:43**********************************@microsof t.com...
Hello.

Do you know how to convert this code to VB.NET?

Thank you.

http://msdn.microsoft.com/es-es/library/bb613590.aspx
Aug 7 '08 #3
Thank you very much, I will prove it and will tell you if it works.

Now I have to verify how there is inserted the code of the example that it
puts " <Page ... ".

"Gillard" wrote:
Imports System
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Controls
Imports System.Windows.Media
Imports System.Windows.Media.Imaging

Namespace SDKSample
Partial Public Class TextBoxBackgroundExample
Inherits Page

Private Sub OnTextBoxTextChanged(ByVal sender As Object, ByVal e As
TextChangedEventArgs)

If myTextBox.Text = "" Then
' Create an ImageBrush.
Dim textImageBrush As New ImageBrush()
textImageBrush.ImageSource = New BitmapImage(New
Uri("TextBoxBackground.gif", UriKind.Relative))
textImageBrush.AlignmentX = AlignmentX.Left
textImageBrush.Stretch = Stretch.None
' Use the brush to paint the button's background.
myTextBox.Background = textImageBrush

Else

myTextBox.Background = Nothing
End If

End Sub

End Class

End Namespace

"Kulber" <Ku****@discussions.microsoft.comwrote in message
news:43**********************************@microsof t.com...
Hello.

Do you know how to convert this code to VB.NET?

Thank you.

http://msdn.microsoft.com/es-es/library/bb613590.aspx

Aug 8 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: |-|erc | last post by:
Hi! Small challenge for you. The index.php uses this file and calls layout(). Take a look at www.chatty.net this file draws the chat login box on the right. I traced the CHAT button it submits...
2
by: nitin | last post by:
g++ -c $INCLUDES ActualPEResult.cpp In file included from /usr/include/c++/3.2.2/backward/iostream.h:31, from /home/pradeepks/Linux_Porting/dcpfrontier/dcpdev/dcp_components/trap...
4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
1
oranoos3000
by: oranoos3000 | last post by:
hi i,m writing a script for chat room i,d like to with clicking close button of browser user is exited from site meaning of this say is with clicking close button all of session variable is...
0
by: shajimon | last post by:
hai All I am very new to PostgreSql. I have given the following code to VB 6. and it takes around 2 to 3 minutes to exicute with PostgreSQL back end. However, the same code work in a fraction of a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.