mua_dong_viet
New Member
mình dùng windows 8.1 pro 64 bit, ram 4Gb
Dùng visual studio Ultimate 2013 32bit.
Visual Studio chạy trên máy thật, không phải máy ảo
khi mình viết một chương trình nhỏ thì nó báo lỗi như sau, nhưng cái lỗi đầu tiên giống như nó bảo cài máy ảo không biết phải không, nếu phải thì khắc phục thế nào?
Cái lỗi thứ 2 thì lại không chỉ rõ hàng nào bị lỗi nên mình cũng chịu?
"Error 1 A method was called on an uninitialized object."
bạn nào chạy thành công trên máy thật giúp mình với
Chương trình mình chạy như sau:
mình có 1 textbox, 1 nút OK và một textblock
ý tưởng là khi mình nhấn nút OK thì dữ liệu mình nhập ở ô textbox sẽ được hiển thị lên textblock đồng thời xóa dữ liệu ở khung textbox đi.
Đầu tiên:


=======================
Code OK_click:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using hellowp.Resources;
namespace hellowp
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
// Sample code to localize the ApplicationBar
//BuildLocalizedApplicationBar();
}
private void OK_click(object sender, RoutedEventArgs e)
{
Textblock1.Text = textbox1.Text;
textbox1.Text = string.Empty;
}
}
} =======================
code file mainpage:
honeApplicationPage
x:Class="hellowp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns
hone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
honeApplicationPage>
Dùng visual studio Ultimate 2013 32bit.
Visual Studio chạy trên máy thật, không phải máy ảo
khi mình viết một chương trình nhỏ thì nó báo lỗi như sau, nhưng cái lỗi đầu tiên giống như nó bảo cài máy ảo không biết phải không, nếu phải thì khắc phục thế nào?
Cái lỗi thứ 2 thì lại không chỉ rõ hàng nào bị lỗi nên mình cũng chịu?
"Error 1 A method was called on an uninitialized object."
bạn nào chạy thành công trên máy thật giúp mình với
Chương trình mình chạy như sau:
mình có 1 textbox, 1 nút OK và một textblock
ý tưởng là khi mình nhấn nút OK thì dữ liệu mình nhập ở ô textbox sẽ được hiển thị lên textblock đồng thời xóa dữ liệu ở khung textbox đi.
Đầu tiên:
=======================
Code OK_click:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using hellowp.Resources;
namespace hellowp
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
// Sample code to localize the ApplicationBar
//BuildLocalizedApplicationBar();
}
private void OK_click(object sender, RoutedEventArgs e)
{
Textblock1.Text = textbox1.Text;
textbox1.Text = string.Empty;
}
}
} =======================
code file mainpage:
x:Class="hellowp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
honeApplicationPage>