w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Change title font for QT Main window
You can't. It's enforced by the system and is only changeable by the user through the desktop preferences. And it's a good thing too, otherwise applications like that would get on people's nerves by not obeying the desktop settings.

Categories : Qt

Change chrome app window location, but not from main.js
You are not supposed to be able to directly change a window's location in a Chrome App. The only part of the location object you can change is the href to reference a fragment in a document. This was an explicit design decision of the Chrome Apps team to stop apps from having the flash of white whilst it navigates between pages. If you look at the window api the only method is create and that takes the URL of what that window should display. That being said, you can load an iframe in the main window and change that. You would just need to set the iframe to be 100% of the width and height of the window.

Categories : Javascript

How to change the template from Widget to Main Window?
It took me three line edits in two files to change a QWidget template to a QMainWindow. Just now in Qt 4.8.4, I did the following: I opened the ui file outside of Qt Creator (after it was closed in Qt Creator) and I edited a line in the file: EDIT: Make a backup of what you are working on, because this editing the ui file is a little un-kosher, and could have strange, undefined repercussions. widget.ui <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>Widget</class> <widget class="QMainWindow" name="Widget"> <!-- This is the line I edited... "QMainWindow" was "QWidget".--> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>400</width> <height>300<

Categories : Qt

My inputcommand keybinding to main window does not work when child window is focussed(same wpf window)?
The key bindings will only work if the Form is focused. You could redirect every Command in your new Window to the Main Window Change your Constructor to of the new Window to accept a Main Window and save this window: MainWindow mainWindow; public Window(MainWindow w) { mainWindow = w; } Whenever a Keybinding executes just do something like this: mainWindow.TabPress(); And show the Window with Window childwindow = new Window(this) { Title = "ChildWindow", Width = 200, Height = 300 }; childwindow.Show();

Categories : C#

localization with .net compact framework
I used the tutorial - guide to do resource localization using Compact Framework: http://www.codeproject.com/Articles/28234/Survival-guide-to-do-resource-localization-using-C

Categories : C#

DataGrid .Net compact framework
What part don't you understand? class Form2 : Form { private static string SQLCONNECTION = @"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;"; private DataGrid dataGrid1; private void button_Click(object sender, EventArgs e) { var table = LoadData("SELECT FirstName, LastName FROM Employees;"); dataGrid1.DataSource = table; } private DataTable LoadData(string sqlCmd) { var table = new DataTable(); using (var cmd = new SqlCommand(sqlCmd, new SqlConnection(SQLCONNECTION))) { cmd.Connection.Open(); table.Load(cmd.ExecuteReader()); cmd.Connection.Close(); } return table; } }

Categories : C#

Async TCP Server in .NET Compact framework
Maybe it is in a part you haven't posted here, but I can't see anywhere some code where you empty the StringBuffer state.sb or the Queue _receivedData (just assuming the types by Name/Method). Filling this two ressources can bring your system to hang as at some point there is no more memory...

Categories : C#

DataGrid column size (Compact Framework) C#
I don't think there is an automatic sizing property. This article show you how to use a DataGridTableStyle to adjust the width of a column. http://support.microsoft.com/kb/330610 If you combine this with the Graphics.MeasureString method you should be able to calculate the required column size. http://msdn.microsoft.com/en-us/library/system.drawing.graphics.measurestring(v=vs.71).aspx Personally I would just set some sensible defaults on the column widths using a DataGridTableStyle and forget about the auto sizing. It becomes a particular pain when you have to start taking into account space for an up/down scroll bar and screen rotation.

Categories : C#

How to access .Net performance counters in compact framework?
I don't think there is an equivalent. But you can install the PerformanceCounter from: http://www.microsoft.com/en-us/download/details.aspx?id=15267

Categories : C#

DrawLines over Image using graphics in compact framework
Creating the grahics of image and drawing lines on to that graphics object has solved my problem. //Ref with above Code //Creating the graphics of the image if exists gxcomp=Graphics.FromImage(im); and //writing my new drawn points on to the graphics gxComp.DrawLines(pen, _currentStroke.ToArray());

Categories : C#

Sqlparameter.Dbtype.Xml giving error in .net compact framework
I had similar experience and this is how I managed it. Use SqlDbType.NVarChar instead of SqlDbType.Xml as shown below DataSet dsWithSomeTable=new DataSet("NameSpace"); tblTable.TableName="Table"; dsWithSomeTable.Tables.Add(tblTable); SqlParameter xml = new SqlParameter { ParameterName = "@XML", SqlDbType = SqlDbType.NVarChar, Value = dsWithSomeTable.GetXml() }; And on the other end in stored procedure handle it by converting it to XML type -- ============================================= -- Description: Inserts records from CE device -- ============================================= CREATE PROCEDURE [Inventory].[uspCEInserXML] @XML NVARCHAR(MAX) = NULL AS BEGIN SET TRANSACTION ISOLATION LEVEL READ UNCOMMITT

Categories : C#

How can I assign enum values to a listbox in .NET 1.1 on the Compact Framework?
You can create your own GetValues method. From this blog post private static int[] GetValues(Type enumType) { if (enumType.BaseType == typeof (Enum)) { //get the public static fields (members of the enum) var fi = enumType.GetFields(BindingFlags.Static | BindingFlags.Public); //create a new enum array var values = new int[fi.Length]; //populate with the values for (var iEnum = 0; iEnum < fi.Length; iEnum++) { values[iEnum] = (int) fi[iEnum].GetValue(null); } //return the array return values; } //the type supplied does not derive from enum throw new ArgumentException("enumType parameter is not a System.Enum"); }

Categories : C#

TcpClient.Connect takes too much time in .NET compact framework
Don't put the socket initialization in the class constructor unless you absolutely must. If you must, hard code the SocketException: private bool abortListener; private TcpListener listener; private TextBox textBox1; public TCP_Class() { abortListener = false; try { listener = new TcpListener(System.Net.IPAddress.Any, 8000); } catch (SocketException err) { listener = null; textBox1.Text = err.Message; } } public void Listen(string ipString, int port) { if ((listener == null) || !String.IsNullOrEmpty(ipString)) { listener = new TcpListener(System.Net.IPAddress.Parse(ipString), port); } listener.Start(); while (!abortListener) { try { using (var client = listener.AcceptTcpClient()) { // ... The rest of the code was left out, but that sh

Categories : Dotnet

Async/await for compact framework v3.5 - manual implementation
I think that adding support for async-await to a platform that doesn't natively support it should be doable, because that's exactly what Microsoft.Bcl.Async does for .Net 4.0. But using async-await requires compiler that supports it, there is no way around that. That means VS 2012 or possibly VS 2010 with the Async CTP (but I wouldn't recommend that, it's not production quality). As far as I know, there is no way to make this work with VS 2008. One more possibility would be to use Mono, but I have no idea if it supports WinCE.

Categories : Dotnet

Attach button to column datagrid in C# Compact Framework .Net 2.0
As far as I know and you said, CF2.0 doesn't allow to add button column. Here is the way that I found as I was searching. Hope this helps.

Categories : C#

How to send more than 8000 bytes in Compact Framework Socket
Is it how you send files thru a socket? There are several ways but I've never seen this one. You don't need to create the buffer for every send, just create it once outsize the loop and use it. From my Windows Mobile I use something like this: byte[] buffer = new byte[8*1024]; // 8kb is ok int iReads=0; while ((iReads=ms.Read(buffer, 0, buffer.Length)) > 0) { sendSock.Send(buffer, 0, iReads); }

Categories : C#

Implementing Single Sign On on Windows Mobile .Net Compact Framework 3.5
I have not been able to personally get Active Directory to work on Windows Mobile. Instead, I created a service running on our network that authenticates using Active Directory. I can call a web service! (Learned about that not too many months back) The username and password, I believe, would be sent as open text (not encrypted), but that is OK for our use.

Categories : Misc

Passing array of values to SQL stored procedure in .net compact framework
If you need to pass only ID's then maybe this function will help you: ALTER FUNCTION [dbo].[fn_SplitIds] ( @text nvarchar(max) ) RETURNS @Ids TABLE ( Id int UNIQUE ) AS BEGIN declare @iStart int, @iPos int if substring( @text, 1, 1 ) = ',' begin set @iStart = 2 insert into @Ids values( null ) end else set @iStart = 1 while 1=1 begin set @iPos = charindex( ',', @text, @iStart ) if @iPos = 0 set @iPos = len( @text )+1 if @iPos - @iStart > 0 insert into @Ids values ( cast(substring( @text, @iStart, @iPos-@iStart ) as int)) else insert into @Ids values( null ) set @iStart = @iPos+1 if @iStart > len( @text ) br

Categories : C#

Get PropertyInfo of a parameter passed as lambda expression | Compact Framework, C#
This can be done under .NETCF 3.5. private List<Asset> m_list; private Asset[] GetPropertyInfo(string name) { var items = m_list.Where(a => a.Name == name); if (items != null) { return items.ToArray(); } else { return null; } } You will, however, need to initialize the m_list and fill it with your data first. UPDATE: So, your list is of type PropertyInfo and you want a call to get the type that matches a particular Asset object. If that is correct, you could simply edit the code above to be as follows: private List<PropertyInfo> m_list; private PropertyInfo GetPropertyInfo(Asset a) { return m_list.FirstOrDefault(x => x.Name == a.Name); } I am not sure how you are getting the List<PropertyInfo>, though. I was able to pull a single Propert

Categories : C#

Loading class with lambda expressions in Compact Framework 3.5 is slow on first load
If the performance delay is consistent (i.e. happens at the same point on the same hardware) then I would attribute the one-time performance delay to JIT compilation. Though not necessarily convenient, a one-time delay is typical of JIT compilation. Since you mention that it only happens in release mode, another consideration may be that the compiler is performing some optimization, such as inlining, that is triggering the delay behavior. One way to test this theory would be to create a release build with optimizations disabled, then see if the problem is reproducible.

Categories : C#

Should an application that updates Windows Mobile 6.5 to Compact Framework 3.5 be .NET 1.0 or native code?
For Windows CE (Windows Embedded Compact now) it is entirely up to the device manufacturer whether they want to include the CompactFramework. However, for Windows Mobile 6 the CF 2.0 SP2 was preinstalled with the OS (So I believe that 6.5 should have it too). I believe that you can probably write .NET CF 2.0 code for it and have it be expected to run. As far as native code, one thing to keep in mind is that if you have different processor architectures then you cannot have the same native code, for example x86 and ARM. However, again I think Windows Mobile 6 only supports ARM processors, so I'm not sure that would be a problem either. I think you could use either one.

Categories : Misc

Tree Menu with grayed-out/disabled text with compact framework limitations
You can realize the derieved classes from TreeView and TreeNode and realize such behavior. using System; using System.Linq; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace SmartDeviceProject3 { public partial class Form1 : Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; private System.Windows.Forms.MainMenu mainMenu1; private TreeViewEx treeView1; public Form1() { this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.treeView1 = new TreeViewEx(); this.SuspendLayout();

Categories : C#

Move record insert to SQL Server CE database into another thread? C# Compact Framework 3.5
If all of your processing is going to be done on the device (reading from the XML file on the device then parsing the data on the device), then you will see no performance increase from threading your work. These Windows Mobile devices only have a single processor, so for them to multithread means one process works for a while, then another process works for a while. You will never have simultaneous processes running at the same time. On the other hand, if the data from your XML file were located on a remote server, you could call the data in chunks. As a chunk arrives, you could process that data in another thread while waiting on the next chunk of data to arrive in the main thread. If all of this work is being done on one device, you will not have good luck with multithreading. You c

Categories : C#

How to manage resources in a console app that creates main window in main()?
Thanks to slugster's posting Access ResourceDictionary items programmatically I was able to load the resources programmatically in my app's loaded event. Example: ResourceDictionary dict = new ResourceDictionary(); dict.Source = new Uri("../Resources/PageDictionary.xaml", UriKind.Relative); Application.Current.Resources.MergedDictionaries.Add(dict); I'm not sure if this is the best solution but it does what I wanted.

Categories : C#

Opening a child dialog window from a main window with Pyside
If your MainWindow have a Menu action named actionAbout, and a slot called openAbout, all you need to do is connect the triggered signal from the actionAbout to the slot openAbout. self.actionAbout.triggered.connect(self.openAbout) The process is similar to what have you done with the pushbutton. Just change the names used in this example with the ones in your application.

Categories : Python

Window instances - how to get my main window canvas inside other class?
Since you do not want to pass your Canvas around as a parameter, you could try creating an Extension Method which would act on your Canvas Object. namespace CustomExtensions { public static class Shapes { public static Ellipse SomeCircle(this Canvas dest) { Ellipse e = new Ellipse(); double size = 10; e.Height = size; e.Width = size; e.Fill = new SolidColorBrush(Colors.Orange); e.Fill.Opacity = 0.8; e.Stroke = new SolidColorBrush(Colors.Black); dest.Children.Add(e); return e; } } } Usage remember to add the CustomExtensions Namespace to your usings. canvas1.SomeCircle();

Categories : C#

window.focus to bring main window in front of popup
According to that post, window.focus() won't work on Chrome because it is disabled. It might be the same for Safari.

Categories : Javascript

How to write a popup window to pass the password to main window?
Here is a Demo of how you could proceed for a custom popup & get the password: HTML: <div id="popup"> <div>Enter Password:</div> <input id="pass" type="password"/> <button onclick="done()">Done</button> </div> <button onclick="showPopup()">Show Popup</button> STYLE: #popup { width:160px; height:80px; padding:20px; background-color:gray; position:absolute; top:100px; left:100px; display:none; } SCRIPT: function done() { document.getElementById("popup").style.display = "none"; var password = document.getElementById("pass").value; //DO STUFF WITH PASSWORD HERE }; function showPopup() { document.getElementById("popup").style.display = "block"; }

Categories : Javascript

How to execute main window key binding when child window is focussed in wpf?
WPF Behavior: Global Application Shortcut Keys Seems to be what you're looking for. I made a couple small modifications to the author's code to get your required functionality(rather than passing in an InputBindings collection, made the Behavior pick it from the AssociatedObject directly. Also took out the restriction for requiring modifier keys, Although I suggest you do read through the author's notes in the article and incorporate it to your requirements) Sample download for your requirements ^^ I could get your required behavior, however do go through the Behavior<T> to see if you can optimise it better for yourself(only bit's I actually looked into was just stuff relating to your specific requirement.)

Categories : C#

Is it possible to receive messages from a parent window which is NOT the main window?
If a control is a child of a tab (or any other control) then it's the tab that will get notification messages like WM_COMMAND. It's easiest to make your controls all children of your main window and just fix the z-order to make them appear in front of the tab (you already have WS_CLIPSIBLINGS set on the tab control, which you would also need). If you leave the controls as children of the tab then the only way to get notification messages is to sub-class the tab. Or, you can do this the way property sheets do it, and use child dialogs (a dialog with the DS_CONTROL style set) to host the tab content. Then you can have a separate dialog procedure that handles messages from the child controls, and it makes it easy to show/hide a whole page of controls rather than handling them all individual

Categories : C++

Hide the icon of main window when navigate to another window
WPF Windows have a ShowInTaskbar property. Set this to false. You may also be interested in this post: C# WPF - Application Icon + ShowInTaskbar = False

Categories : C#

show Login window before main window
You should set Application.ShutdownMode to OnExplicitShutdown (msdn). Example: <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml" ShutdownMode="OnExplicitShutdown" > </Application>

Categories : C#

How to add Branch window to Main window in android?
Main Window(activity) package com.myproject.testprojectonintent; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends Activity implements OnClickListener{ /** the button that I've added in the xml*/ Button startBtn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_screen); /** Get the id of the button from the xml*/ startBtn = (Button) findViewById(R.id.startBtn); startBtn.setOnClickListener( this); } @Override public void onClick(View view) { // TODO Auto-generated method stub /** make

Categories : Android

Calling a Method of parent form in showdialog of child form in Compact Framework Causing ThreadAbortException
There are a few problems here. First, your "parent" form, isn't the Form that called ShowDialog. You're actually creating a whole new Form instance in the Child, so it will not be the same as the Parent that created the Child. Second, ShowDialog creates a separate message pump for the Dialog being shown. Any Windows Messages sent to the Parent are not going to get handled until the Dialog closes and the main message pump starts running again. That means that any UI updates on the parent are not going to happen until the Dialog closes. Third, what you doing is just bad design. If you need the Parent to react in some UI way to the Child, then expose a property in the Child, read it when the Child Closes and handle the updates: class Child : Form { .... public string NewInfo

Categories : C#

Convert OLE Color to System.Drawing.Color in .Net Compact Framework
You can download the tiral version of Reflector and inspect the code of ColorTranslator.FromOle method. Basically, There is a big switch case block where each case returns a Color structure with Color.FromKnownColor method.

Categories : C#

When opening a 'child window' from the main site do i have to create an HTML page for each child window or is there a way to make it generate its own?
Using "popup" windows can be troublesome.. some browsers will not open them properly due to their internal "popup blockers" but to answer your question. if you set the URL of the window to the image itself it should load in the window without the need for a page. i.e. http://www.example.com/img/myimage.jpg A better way to do this would be using a javascript library such as jQuery and jQuery-UI to open modal overlays.

Categories : Javascript

How can I link a new window to the main window?
Maybe through one of your button clicks or constructor you can pass: new BorrowSlipServer().setVisible(true); while also adding some parameters to BorrowSlipServer(String s1,String s2) to pass whatever you want to pass from your main to it. It's still not clear what you mean by "link",do you want to pass things from your MainMenu to BorrowSlipServer or do the opposite? On a side note you may wanna add: setLocationRelativeTo(null); This will center your window on run but make sure you add it after you set the frame size.

Categories : Java

WPF close all window from the main window
Try Application.Current.Shutdown(); From MSDN Calling Shutdown explicitly causes an application to shut down, regardless of the ShutdownMode setting. However, if ShutdownMode is set to OnExplicitShutdown, you must call Shutdown to shut down an application. Important note When Shutdown is called, the application will shut down irrespective of whether the Closing event of any open windows is canceled. This method can be called only from the thread that created the Application object.

Categories : C#

new window appears under main window
As I see it, you have two possible options for making the child Window appear on top of the parent Window. The first was mentioned by @Viv in a comment and that is to set the TopMost property on the child Window to true: omww.Topmost = true; The second option would be to set the Owner property of the child Window to the parent Window (if there is a direct relationship between them): omww.Owner = this; // if called from the parent Window code behind

Categories : C#

How to change position of window controls relative to the window size
Not necessarily the best way, but what I'd probably do is handle WM_SIZE and/or WM_SIZING and then in there use : m_Button.SetWindowPos(x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); where x and y are the new co-ordinates of the top-left of where you want your button.

Categories : Visual Studio 2010



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