|
I have to agree with Dave. You should tell us what you want to display. Probably a customized grid control or something like this would fit better in your situation.
If you still want to use controls you will have to make a UserControl, add your scrollbars to it and then manually reposition all controls when your scrollbars are changed.
|
|
|
|
|
the control is made by a panel with an image as background, some label end textbox within.
|
|
|
|
|
Cuold be done by a grid control. Search for Source Grid 3. It's really cool. You surely would have to exchange the scrollbars.
Another idea:
Instead of placing so many of your controls into one panel you could only place as much as fit into it. When the user then scrolls you just need to exchange their content - not actually scrolling them.
|
|
|
|
|
where have i to serch for Source Grid 3? In this forum?
Another thing how i can to exchange the scrollbars?
|
|
|
|
|
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
|
|
|
|