|
-
Aug 2nd, 2010, 10:53 AM
#1
Thread Starter
Lively Member
[RESOLVED] Wiring up Blend 3 with VB
Hey guys...
All I am trying to do is get my dumb button I created in Blend 4 work on a _Click event. I have the C# equivalent code, but I can't get it converted correctly...Here are both codes...I am using VS2010 just in case you want to know..
C# Code Code:
namespace TestButton1
{
public partial class MainWindow:Window
{
public Page ( )
{
//Required to initialize variables
InitializeComponent ();
}
}
}
VB Code Code:
Namespace TestButton1
Public Partial Class MainWindow
Inherits Window
Public Sub New ()
'This next line does not work and I don't know what is wrong...
Me.InitializeComponent ()
End Sub
End NameSpace
As soon as I can get this very first initialization down, I know I can get the rest of the events written fine.
Thanks guys.
-
Aug 2nd, 2010, 11:17 AM
#2
Re: Wiring up Blend 3 with VB
If you're using expression blend + VB and not C#, why not just create the blend project in VB, so it creates VB code?
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Aug 2nd, 2010, 11:19 AM
#3
Thread Starter
Lively Member
Re: Wiring up Blend 3 with VB
thats what I did, but all it created was a class declaration and an end class statement..
-
Aug 2nd, 2010, 09:33 PM
#4
Re: Wiring up Blend 3 with VB
Perhaps you could define "doesn't work". Also, how exactly was that code generated? From the looks of it it should be getting auto-generated by the IDE when you add a new Window to your project. Is that what happened?
-
Aug 3rd, 2010, 07:23 AM
#5
Thread Starter
Lively Member
Re: Wiring up Blend 3 with VB
well it's working now. JMC, the C# code with the initializecomponent () line was auto generated each time, but the VB code wasn't. Then, every time I tried to put in
Public Sub New ( )
InitializeComponent ()
End Sub
I would get an error saying InitializeComponent wasn't defined. I don't know what I changed or if something just got goofy or what, but now when I put in the "Public Sub New ()" it auto generates the rest of the code for me. It may have been the namespace declaration, because I left that out and the auto-generated code worked...I don't know. Thanks for everyone's input.
-
Aug 3rd, 2010, 08:20 AM
#6
Re: Wiring up Blend 3 with VB
The InitializeComponent method is generated by the IDE when you add a Form or Window using the normal item template.
-
Aug 3rd, 2010, 10:32 AM
#7
Thread Starter
Lively Member
Re: [RESOLVED] Wiring up Blend 3 with VB
I resolved this thread a little prematurely. I can get everything working now except for my state groups. I'm just having my button look like it was actually pushed with some little animations, but my animations are never called or something...this is my code.
Code Code:
Class MainWindow
Inherits Window
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Window.Loaded
VisualStateManager.GoToState(Me, "Base", True)
End Sub
Private Sub TestStartButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles TestStartButton.Click
MessageBox.Show("clicked") 'This works
VisualStateManager.GoToState(Me, "Button_Click", True)
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|