|
1. http://www.devage.com/[^]
2. You will probably have to figure out it yourself. As you can get the whole source code you will just have to find the scrollbar and replace it.
|
|
|
|
|
is it possible to do that using DataGrid or other fully freely controls as Visual Studio are.
i'm forced to wirte their credit in my software
|
|
|
|
|
I'm looking for a way to trace changes in the status of DataGridBoolColumn.
(Checked, Unchecked...)
|
|
|
|
|
Hi,
that's a bit tricky as it is hidden within the class. You could probably do it with reflection but I would recommend taking Reflector, decompiling the whole class and extending the ToggleValue function with a custom event.
|
|
|
|
|
Can you be a bit more specific? Maybe even direct me to an example how to do such a thing?
I have experiance in writing custom controls but I'm not sure that event I need to catch.
|
|
|
|
|
The problem is that you can't modifiy the existing one directly because the needed functions are either internal or protected. Instead of modifying it you could decompile the whole class (you can do this with for example Lutz Röders Reflector) and modify it. You would then have to change the function ToggleValue with some event or whatever suits you best.
When you are finished you would have to add your custom column style instead of the standard one to your grid.
Clear enough?
|
|
|
|
|
Not really. I'm sure there is a much simple solution to this not to complicated problem.
I'll continue look for it.
|
|
|
|
|
Good luck then.
|
|
|
|
|
Hye iam working on a chess game . My selection and movement of pieces in game is dependent upon Mouse Down event as the thingi is being developed in OnPaint event . However , i am working on the idea that if the number of clicks of mouse is 1 it selects the piece and then when i click 2nd time it puts the piece there as in EVEN number of clicks . Naow i have created objects for all squares in the board with their i and j position on matrix BOARD and x and y position signifying coordinates . What i do not figure out is a way IS
1 - When i click in another square i want the piece to disappear from the previous box and redraw in the new box .
2- Wherever i click in the box the piece is put at the exact minimum pixel location rather than missing out the coordinates and being put somewhere on the edge of the square.
3- The declaration of objects of boxes with info on i,j matrix position and the x, y coordinate info should be in
1- MAIN
2- BOARD CLASS (if yes how will it be accessible to mouse down)
3- MOUSE DOWN EVENT
4- The status function which finds out whether there is a piece in that box already or not . Where should this function be and any ideas regarding all of this will be really really really appreciable .
Looking forward to your responses and magnanimous input . REALLY appreciate any help guyz ....... ASAP
|
|
|
|
|
1 - When you click the first time, you store which piece has been clicked on, in memory. When you click, if a piece has been stored to move, you move it.
2 - You store the co-ordinates of each square, and you store the pixel to draw on within that square.
3 - not sure of the question ?
4 - I would have a dictionary which takes a point as a key, and use points that store indexes into the grid. It should be part of the grid class, I reckon, the grid should be responsible for reporting what it can do, and where it is at
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You might also consider looking at the already published articles[^] about chess game programming.
|
|
|
|
|
Hi, can anyone help me with a IEnumerator-problem..?
I have this code that is a few year old, before the Generic.IEnumerator was changed, and now it will not work in Visual Studio 2005 Express:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace Kundekartotek
{
public class CKundekartotek
{
public CKundekartotek()
{
arrKunder = new ArrayList();
KundePegepind = 0;
}
public void NyKunde(string Navn, string Adr, string Tlf)
{
try
{
CKunde MinKunde = new CKunde(Navn, Adr, Tlf);
arrKunder.Add(MinKunde);
}
catch (Exception)
{
throw;
}
}
public void OpdaterKunde(int ID, string Navn, string Adr, string Tlf)
{
try
{
CKunde MinKunde = FindKunde(ID);
MinKunde.Opdater(Navn, Adr, Tlf);
}
catch (Exception)
{
throw;
}
}
public void SletKunde(int ID)
{
try
{
CKunde MinKunde;
MinKunde = FindKunde(ID);
arrKunder.Remove(MinKunde);
}
catch (Exception)
{
throw;
}
}
private CKunde FindKunde(int ID)
{
bool bStopIteration = false;
CKunde MinKunde = null;
IEnumerator<ckunde> MinEnumerator = arrKunder.GetEnumerator();
while (MinEnumerator.MoveNext() && bStopIteration == false)
{
MinKunde = (CKunde)MinEnumerator.Current;
if (MinKunde.ID == ID)
bStopIteration = true;
}
if (bStopIteration == true)
{
return MinKunde;
}
else
{
throw new CKartoteksException("Kunde ej fundet");
}
}
private int KundePegepind;
//FoersteKunde: Sæt pegepind til første kunde og returner denne
public CKunde FoersteKunde()
{
KundePegepind = 0;
if (arrKunder.Count == 0)
{
return null;
}
else
{
return ((CKunde)arrKunder[KundePegepind]);
}
}
//NaesteKunde: Sæt pegepind til næste kunde og returner denne
public CKunde NaesteKunde()
{
++KundePegepind;
if (KundePegepind >= arrKunder.Count)
{
--KundePegepind;
return null;
}
return ((CKunde)arrKunder[KundePegepind]);
}
}
}
Helge
|
|
|
|
|
Use the pre tag when you paste code, so that indentation is preserved.
---
b { font-weight: normal; }
|
|
|
|
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace Kundekartotek
{
public class CKundekartotek
{
public CKundekartotek()
{
arrKunder = new ArrayList();
KundePegepind = 0;
}
public void NyKunde(string Navn, string Adr, string Tlf)
{
try
{
CKunde MinKunde = new CKunde(Navn, Adr, Tlf);
arrKunder.Add(MinKunde);
}
catch (Exception)
{
throw;
}
}
public void OpdaterKunde(int ID, string Navn, string Adr, string Tlf)
{
try
{
CKunde MinKunde = FindKunde(ID);
MinKunde.Opdater(Navn, Adr, Tlf);
}
catch (Exception)
{
throw;
}
}
public void SletKunde(int ID)
{
try
{
CKunde MinKunde;
MinKunde = FindKunde(ID);
arrKunder.Remove(MinKunde);
}
catch (Exception)
{
throw;
}
}
private CKunde FindKunde(int ID)
{
bool bStopIteration = false;
CKunde MinKunde = null;
IEnumerator<CKunde> MinEnumerator = arrKunder.GetEnumerator();
while (MinEnumerator.MoveNext() && bStopIteration == false)
{
MinKunde = (CKunde)MinEnumerator.Current;
if (MinKunde.ID == ID)
bStopIteration = true;
}
if (bStopIteration == true)
{
return MinKunde;
}
else
{
throw new CKartoteksException("Kunde ej fundet");
}
}
private int KundePegepind;
//FoersteKunde: Sæt pegepind til første kunde og returner denne
public CKunde FoersteKunde()
{
KundePegepind = 0;
if (arrKunder.Count == 0)
{
return null;
}
else
{
return ((CKunde)arrKunder[KundePegepind]);
}
}
//NaesteKunde: Sæt pegepind til næste kunde og returner denne
public CKunde NaesteKunde()
{
++KundePegepind;
if (KundePegepind >= arrKunder.Count)
{
--KundePegepind;
return null;
}
return ((CKunde)arrKunder[KundePegepind]);
}
}
}
|
|
|
|
|
What error are you getting? Please paste only the code you're getting an error with (or the entire function containing the error). I cannot compile that code because CKunde is not defined.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Little House on the Flickr
Judah Himango
|
|
|
|
|
Hi, sorry about my poor english, here is the code:
private CKunde FindKunde(int ID)
{
bool bStopIteration = false;
CKunde MinKunde = null;
IEnumerator<CKunde> MinEnumerator = arrKunder.GetEnumerator();
while (MinEnumerator.MoveNext() && bStopIteration == false)
{
MinKunde = (CKunde)MinEnumerator.Current;
if (MinKunde.ID == ID)
bStopIteration = true;
}
if (bStopIteration == true)
{
return MinKunde;
}
else
{
throw new CKartoteksException("Kunde ej fundet");
}
}
....and here is the error-message:
Cannot implicitly convert type 'System.Collections.IEnumerator' to 'System.Collections.Generic.IEnumerator<Kundekartotek.CKunde>'. An explicit conversion exists (are you missing a cast?)
|
|
|
|
|
Hi again..., I have solved the problem, I removed the <ckunde> and now it works, sorry to have disturbed you.
Helge
|
|
|
|
|
Sorry man, i don't know any Finnish (or wathever the language is) .
(But even if it were english, i still wouldn't be able to help... )
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
Do I need to do anything special to get my ListView control to display its column headers?
I've added a couple of ColumnHeader objects (with valid text and widths) to the control's Columns property but they don't appear when the form is displayed. The ListView is currently empty, but that shouldn't cause a problem.
Thanks,
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
You need to set the ListView's View property to "Details".
|
|
|
|
|
Of course - good old report view! Thanks!
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I am trying to write a Windows Service that monitors the system for user input (either through mouse or keyboard), and shuts the system down if it has been inactive for a certain period of time. It has to be a service, because a primary requirement is that it shuts down a PC sitting at a login window.
The service needs GUI for 1) Adjusting the service settings or monitoring the service in real-time, and 2) To provide a warning window if the machine is about to shut down (only when someone has logged in).
I created the project as a Windows Service, then wrote and debugged it using Main to get the application to run, as follows:
public class AutoShutdown_Class : System.ServiceProcess.ServiceBase<br />
{<br />
<br />
.<br />
.<br />
.<br />
<br />
public static void Main ()<br />
{<br />
System.ServiceProcess.ServiceBase.Run(new AutoShutdown_Class());<br />
<br />
<br />
Event_Watcher Events = new Event_Watcher();<br />
Application.Run(new Settings());<br />
}
The program has the following classes:
1.Auto Shutdown Service - service constructor, Main, OnStart, OnStop
2.Event Watcher - monitors the system to see if there is any user input, and keeps track of how long the system has been idle. Reads and writes settings from/to a file. Shuts the PC down if it has been idle for a certain period of time.
3.Settings - Windows Form that displays a status window, which is accessed by a user through a system tray icon. Changes the user makes to the settings are passed to the Event Watcher
4.Warning - Windows Form that displays a message when a system is about to be shutdown (only when a user is logged in).
It runs as intended during debugging when coded as above; however, when I try to move the last 2 lines of code from Main into OnStart (then compile and installutil), the service won't start as it says there is no work to be done.
It seems like I've followed the wrong approach and now need to figure out how to get back on track. From reading various message boards, it appears that I need to separate the above into an application and service. I've read some (extremely abstract) code about named pipes, but I really haven't been able to make sense of 1) What parts would go into the application and what would stay in the service, and 2) how the 2 would communicate.
Any and all suggestions are welcomed
|
|
|
|
|
I still haven't gotten anywhere on this, so any help would be greatly appreciated.
|
|
|
|
|
let me know if you do. I'm trying to turn a GUI app into a service and can't find any tutorials or anything.
My articles
BlackDice
|
|
|
|
|
I'm trying to read from a text file "Amine.txt", I'm gettin a compiling error <'System.IO.StreamReader' does not contain a definition for 'close'>
here is my code:
static void Main(string[] args)
{
StreamReader re = File.OpenText("Amine.txt");
string input = null;
while ((input = re.ReadLine()) != null)
{
Console.WriteLine(input);
}
re.close;
return 0;
aPerfectTool
|
|
|
|