w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Populating picture boxes from file path. Windows Metro App, Store App, Windows 8 App
See If all the directories were given access for a win rt app then it would be a security risk So some specific folder are available try storing user data in there . After that only File Picker can Help. Heres the link Folders for winrt Its a Microsoft policy so Please design app accordingly. You might needd to set capabilities in the app manifest file for some folders. Please go through it :)

Categories : C#

Using DirectXTK to save screenshots in Windows Store app (Metro)
Windows Store apps are sandboxed and have fewer permissions than desktop apps, especially when it comes to file access. By default, apps only have access to write to the local storage directory, which isn't easily accessible from the shell. If you want to save to the Pictures or Documents library, you will need to specify this access in the package manifest. Additionally, you will need to use the WinRT file APIs to write the DDS files. To do this, use SaveDDSTextureToMemory, then write the resulting raw DDS data to the StorageFile. Check out the File access sample for more info on the WinRT APIs involved in writing this data as a file.

Categories : Visual C++

C# Windows 8 Store (Metro, WinRT) Byte array to BitmapImage
This is working for me, private async Task<BitmapImage> ByteArrayToBitmapImage(byte[] byteArray) { var bitmapImage = new BitmapImage(); var stream = new InMemoryRandomAccessStream(); await stream.WriteAsync(byteArray.AsBuffer()); stream.Seek(0); bitmapImage.SetSource(stream); return bitmapImage; }

Categories : C#

Playing simple sounds in a Windows Store (Metro) application
Based on this article, below works OK for me: public async Task<IRandomAccessStream> BeepBeep(int Amplitude, int Frequency, int Duration) { double A = ((Amplitude * (System.Math.Pow(2, 15))) / 1000) - 1; double DeltaFT = 2 * Math.PI * Frequency / 44100.0; int Samples = 441 * Duration / 10; int Bytes = Samples * 4; int[] Hdr = { 0X46464952, 36 + Bytes, 0X45564157, 0X20746D66, 16, 0X20001, 44100, 176400, 0X100004, 0X61746164, Bytes }; InMemoryRandomAccessStream ims = new InMemoryRandomAccessStream(); IOutputStream outStream = ims.GetOutputStreamAt(0); DataWriter dw = new DataWriter(outStream); dw.ByteOrder = ByteOrder.LittleEndian; for (int I = 0; I < Hdr.Length; I++) { dw.WriteInt32(Hdr[I]); } for (int T = 0; T < Sa

Categories : C#

How to store a Dictionary inside a Container in Windows 8 Metro app?
You can use XML serialization. ApplicationData.Current.LocalSettings doesn't support all the data types. There are also some libs available which provide feature similar to isolated storage. They also use XML serialization. Generic Object Storage Helper for WinRT Windows 8 Isolated Storage

Categories : C#

What is the proper method of grouping a Collection in Windows Store App (Metro) using LINQ and VB.NET?
I found a solution, though I don't know that it is the ideal solution. Because the result of the LINQ query places the items in the Group property of its anonymous type, CollectionViewSource needs to know that. So by adding ItemsPath="Group" to the XAML defining the CollectionViewSource, it now displays both the group headers and the containing items.

Categories : Vb.Net

Creating a comboBox with all available fonts (from C# to C++/CLI)
Inspired by this site ,You may write like this: list<string>* fonts = new list<string>(); System::Collections::IEnumerator^ myEnum = FontFamily::Families->GetEnumerator(); while (myEnum->MoveNext()) { FontFamily^ oneFontFamily = safe_cast<FontFamily^>(myEnum->Current); fonts->push_back(oneFontFamily->Name); } fonts here is a pointer, something does not exist in C#, be aware!

Categories : C++

Windows Batch file - can't get variable to store fill file name with spaces
I kind of remember, when you work with paths in DOS, you can either do it this way "c:Dir1Dir1.1File.ext" or this way c:"Dir One""Dir One.One""File X.ext"

Categories : Windows

Preload page on metro app store
Check out WinRT XAML Toolkit. It has introduced two controls AlternativeFrame and AlternativePage. As per documentation - AlternativeFrame, AlternativePage - support asynchronous page transitions and preloading pages so when navigation is initiated - all content might already be loaded. Includes 4 built-in transitions: dissolve, flip, push, wipe. You can add new ones yourself. It does contain the method you are looking for - AlternativeFrame.Preload() to preload the pages in Visual Tree.

Categories : C#

Mediaelement in Windows 8 Metro App
To open files on the local system, you can use the FileOpenPicker to get the file and SetSource to set the media source. var openPicker = new Windows.Storage.Pickers.FileOpenPicker(); openPicker.FileTypeFilter.Add(".mp3"); var file = await openPicker.PickSingleFileAsync(); var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read); if (null != file) { mediaElement.SetSource(stream, file.ContentType); mediaElement.Play(); }

Categories : C#

Transparency in Windows 8 (Metro App)
Per an older question, the trick to allow a child element to override the opacity is to use a brush on the parent's background instead: <Grid.Background> <SolidColorBrush Color="Black" Opacity="0.5"/> </Grid.Background> You can find more here: How do you override the opacity of a parent control in WPF?

Categories : C#

Fill combobox with a matrix
Here's a simple helper method you can use to get one column out of a two dimensional array: public static IEnumerable<T> GetColumn<T>(T[,] array, int column) { for (int i = 0; i < array.GetLength(0); i++) yield return array[i, column]; } Using that you can just modify your code to: comboBank.DataSource = codes.GetColumn(1); Having said that, the real issue here is that you're using a multi-dimensional array when what you really should have is a single dimensional array of some object that contains both an int and a string. public class Code { public int ID { get; set; } public string Name { get; set; } } Code[] codes = new Code[]{ new Code(){ID=1, Name="BANK S/A"}, new Code(){ID=2, Name="BANK Center"}, new Code(){ID=3, Name="BANK AM

Categories : C#

Convert a Windows Forms app to Metro UI app
I think it's quite difficult. Maybe we can seperate the logical code and UI code , reserve the logical code and recreate a UI for Metro Style. It's hard to convert the WinForm UI code to Metro's. Metro apps based on WinRT have many differents from WinForm, not only the namespace or method name but some implementing code are different. There are lots of method we can use or information we can get in WinForm are not supported in Metro. Converting WinForm to Metro will be a large project I think.

Categories : Windows

Windows 8,launch outlook from metro application
First of all Need to check the url the code should be var mailto = new Uri("mailto:rbethamcharla@hotmail.com"); await Windows.System.Launcher.LaunchUriAsync(mailto); then it receives the email address. Secondly you can go through the link from msdn access outlook MSDN Some steps might be helpful. Try making outlook your by default mail client.

Categories : C#

Read XML file fom "My documents" with metro app Windows 8
You need to go to Properties, capabilities and activate Document Library Access capability. Then you need to update the app manifest declaring what type of document you want to te able to read ".xml" in your case; this can be done from the declarations tab. This can be done, however, bear in mind this is not the best option for neither the user or you, the developer. For the user this is unsafe and will have to accept the capability, thing that may (though I doubt it) draw back some users. On the other hand, the user may modify this XML easier (or another app) and you will have to deal with it.

Categories : C#

Parse Youtube Playlist in Windows Metro App
You need to use a feed URL that returns JSON and not videos URL which returns HTML. Here is a sameple JSFIDDLE

Categories : Jquery

How to implement drag and drop in c# windows metro app?
See the following: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/53a42865-6e96-4439-85dd-5e90e0ec8512/drag-and-drop-in-metro-apps Use a grid template and set CanDragItems="True" CanReorderItems="True" and AllowDrop="True". A comprehensive guide can be found here: http://blog.jerrynixon.com/2013/06/walkthrough-reordering-items-in.html

Categories : C#

FileSavePicker in Light theme on C# windows metro App
The FileSavePicker colours are defined by the user's theme preferences, not by your application. It cannot be modified by StandardStyles.xaml. In order that your app can't try and impersonate a system dialog (like FileSavePicker) your application doesn't have access to those user preferences.

Categories : C#

Overlay an Image onto a video in windows 8 metro App using c#
If you're using XAML, you can easily add 2 overlapped controls, one on the background for the video and one for the image in the foreground. To make sure of the z-order, you can adjust the Z-Index of your controls. With a transparent image control you should not have difficulty pulling this off.

Categories : C#

How to apply the same theme in all WPF windows using MahApps.Metro
In your App.xaml, set the ResourceDictionary property like this: <Application.Resources> <ResourceDictionary Source="MyResourceDictionary.xaml"/> </Application.Resources> Notice that in order for the styles in your resource dictionary to be applied to all controls of that type, the style should NOT have a key. For example, a style defined like this: <Style TargetType="{x:Type Button}"> <Setter Property="Content" Value="This is the default button text"/> </Style> In the ResourceDictionary will cause all the buttons in the project to have a default value when you create them.

Categories : C#

i want to fill my field on click of combobox in for loop
as the code show there stands <script type="text/javascript"> function Expedisi(t) { var y; for(var i=0; i<y.length;i++){ document.getElementById("code").innerHTML=y[i]; y[i].value = t.value; } } </script> y is empty so y.length is always going to be 0, in other wordt there is nothing to loop through

Categories : PHP

auto-fill from combobox when typing into textbox
Change the AutoCompleteMode to Suggest. This is a property of the ComboBox. Also make sure to change the AutoCompleteSource to ListItems, that will use its own list of items as the AutoComplete source. http://msdn.microsoft.com/en-us/library/system.windows.forms.autocompletemode.aspx

Categories : Dotnet

how to use combobox as a dropdown list and textbox in asp.net like combobox
HTML4 does not include any <input> element that provides functionality similar to Windows' ComboBox control - you have to use separate <input type="text"> and <select> elements as fallback. HTML5 does provide for this via the <datalist> element, which is currently supported by all current-version browsers except Safari (for both Mac OS X and iOS): http://caniuse.com/datalist For everything else, I strongly suggest using jQuery's Autocomplete add-in which has a combobox mode: http://jqueryui.com/autocomplete/#combobox

Categories : Asp Net

Windows Metro App : How can I add stuff on my screen which is displayed only when I scroll on it?
The standard way for managing application options is using App Settings API. You can use this sample from MSDN http://code.msdn.microsoft.com/windowsapps/app-settings-sample-1f762f49 If you really insist on having horizontal scrollbar, then maybe you need a ScrollViewer <ScrollViewer HorizontalScrollBarVisibility="Visible" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" > <StackPanel Orientation="Horizontal" > <ListView Width="400"/> <ListView Width="400"/> <ListView Width="400"/> <ListView Width="400" Background="Wheat"/> <ListView Height="396" Width="400"/> </StackPanel> </ScrollViewer> Also you may consider using FlipView or Navigation API fo

Categories : Windows

Programmatically removing an Object from a Grid in Windows Metro
In the class header I've declared private: concurrency::reader_writer_lock myLock; And changed the implementation to: storyboard->Completed += ref new EventHandler<Object^> ([this,birthImage](Object^ sender, Object^ e) { unsigned int index; myLock.lock(); if (mainGrid->Children->IndexOf (myImage, &index)) { mainGrid->Children->RemoveAt (index); } myLock.unlock(); }); Notice the declaration of unsigned int index as a local variable to the lambda function.

Categories : C++

How to display partial HTML page in Windows 8 metro app
to actually write any solution code I would need to know what are Content1 and content3. assuming them being DIV with an ID, I can say void WebView5_LoadCompleted(object sender, NavigationEventArgs e) { string script = @"var d=document.getElementById('content1');d.style.visibility='hidden'"; string[] args = { script }; string foo = WebView5.InvokeScript("eval", args); }`

Categories : C#

Windows 8 Metro app, How to set a click event for different images that are loaded?
This is a case where anonymous delegates or lambdas come in handy: Image chordA = new Image(); // ... chordA.Tapped += (sender, e) => { //lambda //do what you want with chord A textBlock.Text = "A chord clicked"; } OR Image chordA = new Image(); // ... chordA.Tapped += delegate (object sender, TappedRoutedEventArgs e) { //anonymous delegate //do what you want with chord A textBlock.Text = "A chord clicked"; } When creating your chords, simply assign an anonymous delegate or lambda. You can specify in each anonymous method what is to happen to your particular chord. See lambdas and delegates.

Categories : C#

windows 8 metro app, Close method was missing in System.Net.HttpWebResponse
Not all methods (or classes) are supported in all versions of the .Net Framework. If you look at the documentation for the HttpWebResponse Class, you will see these methods (among others): Each method has a symbol which precedes the name:   means that the method is public; it is implied that the method is available for use in projects that use the full version of the .Net Framework.   means that the method is available for use in Portable Class Library projects.   means that the method is available for use in Windows Store projects. You will note that Close and CreateObjRef methods are only available in projects that use the full version of the .Net Framework. The Dispose method is available for use in all three kinds of .Net projects (full .Net Framework, Portable C

Categories : Dotnet

Change delimited by comma procedure to fill combobox with range from Excel Sheet
From your comments, I understand that what you want is to replace the loop and the line where the Combobox is being populated with this: For i As Integer = 1 To xlRng.Rows.Count cmbSelectPosition.Items.Add(DirectCast(xlRng.Rows(i), Excel.Range).Value) Next

Categories : Vb.Net

How to achieve SematicZoom like Windows App Store in Windows store app?
You can achieve this by wrapping the GridView with a SemanticZoom object <CollectionViewSource x:Name="Results" Source="{Binding esults}" IsSourceGrouped="true" ItemsPath="Items"/> <SemanticZoom > <SemanticZoom.ZoomedOutView> <GridView ItemsSource="{Binding CollectionGroups, Source={StaticResource Results}}"> <GridView.ItemTemplate> <DataTemplate> <!-- Template for ZoomedOut --> </DataTemplate> </GridView.ItemTemplate> </GridView> </SemanticZoom.ZoomedOutView> <SemanticZoom.ZoomedInView> <GridView x:Name="itemGridView" ItemsSource="{Binding Source={Sta

Categories : C#

Windows 8 Metro does not launch, "The process started, but the activation request failed with error 'The app didn't start'."
This has the answer for you: http://msdn.microsoft.com/en-us/library/vstudio/ms241613.aspx Alternatively, when you publish your project in Visual Studio from the Project > Store > Create App Packages menu, you get the APPX together with a PowerShell script for the installation. Make sure you have a dev license on the target machine before installing.

Categories : C#

How to retrieve image files from Sharepoint Image Library (List) through REST API using C# in Windows Store App
The following example demonstrates how to retrieve a specific file content from library: url: http://site url/_api/web/lists/getbytitle('<list title>')/items(<item id>)/File/$value method: GET headers: Authorization: "Bearer " + accessToken Example HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); var response = client.GetAsync("https://tenant.sharepoint.com/_api/web/lists/getbytitle('Documents')/items(1)/File/$value", HttpCompletionOption.ResponseHeadersRead).Result; var fileContent = response.Content.ReadAsByteArrayAsync().Result; References Working with folders and files with REST

Categories : Rest

I have to open windows fonts folder after install my application by installaware
The required procedure is described over at MSDN. To summarise: Copy the font to the %windir%fonts folder. Call AddFontResource or AddFontResourceEx. Broadcast the WM_FONTCHANGE message to all top-level windows. It may be easier to find a way to persuade your installer tool to do this work for you.

Categories : Delphi

Chrome wrapping text when using multiple languages and web fonts on windows
I had a similar problem with various Google Web fonts in Chrome. I added a space to the end of the printed text and chrome was able to resolve the length and wrapping properly. My 2c on why this works My guess is there is some extra step in rendering web-fonts and executes after the css-preprocessor has worked out the font spacing. Adding the extra space acts as a buffer for the css preprocessor.

Categories : CSS

Combobox store loaded but won't display
The issue mainly here is, when your combobox is created the MyApp.app.globals.cmbServiceStore is null or undefined, once the combobox is initialized and then you try to define your store it doesn't the combobox as the reference given during initialization to combobox was undefined. Based on your code it seems that you are just changing the data of the store and not the store fields. So its much better you create the store before combobox initialization and then on combox change you just add the data to store by using store.add I would recommend another approach, that is add a proxy to your store for the service and just do store.load() on combo change

Categories : Javascript

Extjs one store bind to more combobox
For example, on Controller, we will use a function on load combo store event: init : function() { this.getNameComboStore().on('load', this.functionLoadStore, this); }, ... functionLoadStore : (store){ if(store.count>0){ store.suspendEvents(false); // break the load event (supends all events) store.resumeEvents(); // resume the event, it's IMPORTANT! } } In the function, we compare the number of elements charge, if count>0, supend the load event, and resume again.

Categories : Extjs

How to set value to combobox with remote store in extjs 4.2
I think beneath loading the data bookCombo.setValue(book.getId()); should be enough to set the value in your combo. The change event should fire automatically as soon as you set a value. And rest get called automatically after calling setValue I think you mess it up by calling all these yourself.

Categories : Extjs

Set combobox value after loading json store
You shouldn't have to loadRawData. From the looks of your code, your store needs to be changed or you need to use a portion of your JSON data being returned. Your root is 'cpaList'. The store doesn't know what to do with this. If you want to keep your code the way it is, then do the following: Ext.getCmp("combovalue2").getStore().loadData(value2.cpaList); Otherwise you will have to change your store to match your data. If you actually define this store instead and then set your combo store to the defined store, it will autoLoad on render instead. Then you don't have to fire a separate AJAX request and your code is all related to your store now. var store = Ext.create('Ext.data.Store', { autoLoad: true, proxy: { type: 'ajax', url: '/whateveryoururlis',

Categories : Extjs

Extjs 4 grid combobox store from dataIndex
Using columnCfgs you can create a renderer - the third parameter to this function is the record getting passed into the grid. The renderer function requires a 'return' statement so try returning a combobox whose store contains the data from record.availablePosition or whatever name the data is stored under. Here's an example of using a renderer (3 different times): Which comes from this github code: Blocking History

Categories : Javascript

Combobox not loading displaying store data - Ext JS
You shouldn't define fields in your store if you are using a Model. Also. the data you have in your store is most likely not what you are looking for. You have 3 different records, each with only one of your fields populated. You probably want this: data : [ { TECH_NAME: 'TECH_NAME', KBE_ID: 'KBE_ID', KBE_NAME: 'KBE_NAME' } ]

Categories : Extjs



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.