|
Hie again!
My friend has sent me a controlcode for viewing a GISMAP,but unfortunately I don't know how to use it.I mean how can I add a map in a C# project to view that map?
|
|
|
|
|
Please read the forum guidelines and going forward give your messages a title with meaning.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
maybe your friend knows ?
|
|
|
|
|
Considering we know NOTHING of the control (is it really?) he sent you, you're ONLY two sources of information on how to use it are (1) your friend, and (2) the manufacturer of the control.
|
|
|
|
|
Like the other posters have replied, try your friend and the control manufacturer. Your post is not very detailed...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hello,
I thought this would be easy to do but the answers I have found tend to involve writing a strongly typed data table or adding a linked table in SQL Server.
My SQL Server table has a value listed of 1 and 0 in the column for Status. I have added a DataGridView control to my form and I want to change the 1 to "Administrator" and the 0 to "User". Is there a simple way of doing this without adding a data table to my SQL Server or typing a strongly typed Data table class?
Thanks,
Boyd
Boyd
|
|
|
|
|
Yes, you can use a calculated column. For example:
DataTable table;
table = ....
table.Columns.Add("TextStatus", typeof(string), "IIF(Status = 1, 'Administrator', 'User')"); For more things you can do with calculated columns, check DataTable.Expression[^]
I hope this helps!
|
|
|
|
|
Can you try this in your SQL statement when retrive the data:
SELECT
....
StatusValue = CASE WHEN Status = 1 THEN 'Administrator' ELSE 'User' END
FROM
...
Not sure this answer your question?
Eliz.K
|
|
|
|
|
Hi All,
This is Windows Forms, not web.
I've got a class, who's properties are normally exposed to my users in a PropertyGrid control.
Some of the properties have attributes from the System.ComponentModel namespace to hide, force read only, or rename attributes (DisplayName, ReadOnly, Browsable etc).
Now, for some users (those with a superuser access), I need to expose some of the hidden properties, in a DataGridView.
But the attributes are causing problems... When I bind a DataGridView to a List<t> of my objects, only the columns shown in the PropertyGrid are shown.
Even if I disable automatic column generation, and try to manually create columns, like this:-
dataGridView1.AutoGenerateColumns = false;
dataGridView1.DataSource = my List<T>;
DataGridViewColumn column = new DataGridViewTextBoxColumn();
column.Name = "Column Name";
column.DataPropertyName = "HiddenProperty";
dataGridView1.Columns.Add(column);
The created column simply comes out blank.
Does anyone know a way round this? Other than (of course) losing the databinding functionality and filling the DataGridView manually?
Thanks
Jon
|
|
|
|
|
|
Guys,
How can I access a shared secured folder from code (VB/C#) that will not show the UserName/Password dialogue box?
Thank you
ThaScorpion
ThaScorpion
|
|
|
|
|
If the account your code is running under isn't recognized by the server, you MUST supply a username and password to it in order for it to let you into the Share. You simply have no way around this.
You can find an example of logging into a remote server here[^].
If you don't have appropriate credentials recognized by the remote server, you're outta luck until you get an account that IS recognized.
|
|
|
|
|
How do I get the user's current wallpaper bitmap? (keeping in mind that the user might have set the wallpaper with either the desktop properties control panel applet, or with the SetParametersInfo method in user32.dll) Is there an API call that returns a bitmap or a handle that I can use to create a Bitmap object?
I'm not wanting to change or alter the wallpaper, I'm wanting to display it as a Bitmap object on a Form.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Microsoft.Win32 is used for accessing the registry, while System.Runtime.InteropServices is used for accessing the unmanaged user32.dll.
Next comes the preparation of the unmanaged function SystemParametersInfo() - this should be located at the top of the class definition:
[DllImport("user32.dll", CharSet = CharSet.Auto)]<br />
<br />
static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
First thing is to retrieve the current desktop wallpaper, and to do that we don't need to use a function, but simply read a value in the Windows registry. Let's create the method for that:
private string GetCurrentWallpaper()<br />
<br />
{<br />
<br />
<br />
RegistryKey rkWallPaper = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", false);<br />
<br />
string WallpaperPath = rkWallPaper.GetValue("WallPaper").ToString();<br />
<br />
rkWallPaper.Close();<br />
<br />
<br />
return WallpaperPath;<br />
<br />
}
Next comes the definition of the method that actually sets the wallpaper, Additional for you . And it's only a few lines of code:
private void SetWallpaper(string WallpaperLocation, int WallpaperStyle, int TileWallpaper)
{
// Sets the actual wallpaper
SystemParametersInfo(20, 0, WallpaperLocation, 0x01 | 0x02);
// Set the wallpaper style to streched (can be changed to tile, center, maintain aspect ratio, etc.
RegistryKey rkWallPaper = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);
// Sets the wallpaper style
rkWallPaper.SetValue("WallpaperStyle", WallpaperStyle);
// Whether or not this wallpaper will be displayed as a tile
rkWallPaper.SetValue("TileWallpaper", TileWallpaper);
rkWallPaper.Close();
}
|
|
|
|
|
I only needed to get the wallpaper. I didn't know that the registry's value was updated that well (I just looked on mine and it's correct, despite me circumventing the control panel applet), so I'm good to go. I already know how to set the wallpaper (and I have a handy app available for free download from my blog). Thank you for the info! It helps me greatly!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hi!
I developed a Pocket PC application in VS2005 and i want to deploy it on Pocket PC so how do i make setup and deploy to it. Any suggestion will be appreciated.
Thanks in advance.
|
|
|
|
|
Its the same as a windows application,
In new project, select Other Project Types, Setup and Deployment and select
Smart Device Cab Project
|
|
|
|
|
|
Thanks Jalpesh B. Patel.
Dear Patel i found Add Project output Group empty after so how do i achieve this; "In the File System pane, right-click Application Folder and select Add—>Project Output…. Add Project Output Group window, select Primary output set Primary output."
Thanks again
waiting for your response.
|
|
|
|
|
i am working with a project likely to be a media player.
can sum one tell me how to play video files in c#?
which namespace to be included?
which class to be used?
with thanks...
|
|
|
|
|
Namespace: System.Media
http://msdn2.microsoft.com/en-us/library/system.media.aspx
|
|
|
|
|
System.Media just contain classes for Sound Player but not 4 vido files. If u know how to play video files , can u give me a short codes
|
|
|
|
|
You should look into WPF it has some fantastic ability to handle media files. Try this article
http://msdn.microsoft.com/msdnmag/issues/07/03/DigitalMedia/default.aspx
|
|
|
|
|
Greetings
I am trying to make threads that run loops to be at the exact same step as the other threads. For example an output to the application could be the following:
Thread 1 = iteration 1
Thread 2 = iteration 1
Thread 3 = iteration 1
Thread 4 = iteration 1
Thread 1 = iteration 2
Thread 2 = iteration 2
Thread 3 = iteration 2
Thread 4 = iteration 2
and not
Thread 1 = iteration 3
Thread 2 = iteration 2
Thread 3 = iteration 1
Thread 4 = iteration 1
Thread 1 = iteration 4
Thread 2 = iteration 3
Thread 3 = iteration 2
Thread 4 = iteration 1
I am thinking of an implementation such as:
the first thread runs the iteration and waits
the second thread runs the iteration and waits...
the last thread runs the iteration and notifies all the other threads to wake (and go to the next step)
I have tried the following but it doesnt work:
<br />
CommonClass commonObject = (CommonClass)o;
for (int i = 0; i < 4; i++)<br />
{<br />
Console.WriteLine("Thread " + Thread.CurrentThread.Name + " is in iteration " + i);<br />
lock (commonObject)<br />
{<br />
if (Interlocked.Decrement(ref threadCounter) == 1)
{<br />
threadCounter = 4;
Monitor.PulseAll(commonObject);
}<br />
else { Monitor.Wait(commonObject); }
} <br />
}<br />
Do you find this approach correct?
Can you please suggest feasible solution?
Thanks in advance
|
|
|
|
|
Disclaimer: although I have studied threading, I am no guru, so take my suggestion with a grain of salt.
Also I'm not sure of .NET threading syntax, so everything will be in pseudocode.
---
Have one thread act as a scheduler for the rest of the threads, telling them when they are allowed to run.
1. Start running each thread.
2. When a thread completes an iteration, tell it to Wait on some condition variable that is regulated by the scheduler thread.
3. The scheduler thread will do nothing until the wait queue is "full" IE all available thread are waiting, or the "running" queue is empty.
4. The scheduler broadcasts to all waiting threads, telling them to wake up and start running.
|
|
|
|