|
Please don't cross post.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi
in windows application , i have 3 text boxes which takes intput as decimal
now in en-US setting '.' is treated as '.' only
but in da-DK (danish Denmark) ',' is treated as '.'
and '.' is treated as ','
how to apply these settings to text boxes
i found an alternative way like this
i m replacing ',' as '.' in da-DK cuture
i know that it is not the correct way
is there any solutions for this
|
|
|
|
|
vijaylumar wrote: how to apply these settings to text boxes
They apply themselves. A textbox has no idea what you're entering, it doesn't know it's a number. int.TryParse or float.Parse, or whatever, will use the current culture.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
can you tell how to apply globalization in windows applications
thanking you
|
|
|
|
|
You can apply your chosen culture in overloaded methods if you don't want to use the default culture.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi, everybody
How to retrieve the index of items in a ListBox and
then using a loop make a statement on each element of the listbox until last.
Thank for your help
|
|
|
|
|
What have you tried ? It's very basic. Do you have any C# or winforms books ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
In reality I am a beginner in C #.
|
|
|
|
|
Well, you won't learn anything if instead of reading books, you ask us to provide you with the most basic code without trying to write it yourself.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I'm realizing a application that will enable me via my USB bluetooth detect mobile and then list them in my ListBox. And each of my mobile ListBox send a message, but automatically.
|
|
|
|
|
Sounds like far too complex an application for someone who doesn't know how to iterate over a listbox's items. Try something more basic first.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If you have a syntax that allows me to retrieve the index of elements in a ListBox, its me far enough. Thank you
|
|
|
|
|
Go out and buy an introductory book on C#. Study that for one week and you will leap ahead.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I want to know how can i get the number of times a window has been visited
|
|
|
|
|
You would need to write code to track that value yourself.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You can use a class level static integer variable for this. Increment it in the load event of your form. If you need the value next time the application is opened, either save it in database or in config file or in registry.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi All,
Is there anyone in here have some sort of expeience with Janus Grid, if you do, can you please read through.
This is about format a cell in Janus Grid, such as:
GridEXFormatCondition fco = new GridEXFormatCondition(
this.gridEX1.RootTable.Columns[4],
ConditionOperator.Equal, true);
fco.TargetColumn = this.gridEX1.RootTable.Columns[4];
fco.TargetColumn.CellStyle.BackColor = Color.LightYellow;
This piece of code formats the back color of whole Columns[4] to light yellow, now what i really want is to format a cell, rather than the whole Columns[4] to light yellow.
If someone in here can shed me a light will be great.
|
|
|
|
|
Dont worry, guys, I already worked it out myself. here is the solutionif anyone come across the same issue next time:
basically once the target column be pointed, then the fco applys on that sepcific cell when condition meets:
GridEXFormatCondition fco = new GridEXFormatCondition(
this.gridEX1.RootTable.Columns[4],
ConditionOperator.Equal, true);
fco.TargetColumn = this.gridEX1.RootTable.Columns[4];
fco.FormatStyle.BackColor = Color.LightYellow;
|
|
|
|
|
Hi.
i face a Error
Unable to cast object of type 'System.Windows.Forms.TextBox' to type 'System.IConvertible'.
When I Do this
int ProdTotal=0;
ConTotalTxt.Text = Convert.ToString(Convert.ToInt32(ProdTotTxt) + ProdTotal);
in this code where i do mistak???
thanks in Advance
Jawad Khatri
|
|
|
|
|
What is the type of ProdTotTxt ? If it is a textbox, you need to write like ProdTotTxt.Text
Best wishes,
Navaneeth
|
|
|
|
|
oohhh...Sorry ..
you right
thanks Sir
|
|
|
|
|
I'm having trouble implementing a depth chart for my football simulator program. The way my program is structured, I have a Player class, a Team class, and a League class--the core classes. The depthchart would group players by their position and, by each position, sort by OVR (integer) in descending order (but only if their injury status is "false"--governed by a CanPlay method in my Player class; otherwise, they are not eligible for the depthchart). Position is a PlayerPosition type and PlayerPosition is enumerated as such:
[code]
public enum PlayerPosition { QB, HB, WR, TE, LT, LG, C, RG, RT, DE, DT, OLB, MLB, CB, FS, SS }
[/code]
This is in my Team class:
[code]
public List<Player> depthChart { get; set; }
public List<Player>[] DepthChart
{
get
{
var result = new List<Player>[Enum.GetValues(typeof(PlayerPosition)).Length];
foreach (PlayerPosition pos in Enum.GetValues(typeof(PlayerPosition)))
{
result[(int)pos] = this.Players.Where(pl => pl.position == pos && pl.CanPlay).OrderByDescending(pl => pl.OVR).ToList();
}
return result;
}
[/code]
These are in my Main() method: two attempts to obtain information from the depth chart.
Method 1:
[code]
Team t = league.Teams[0];
var depthChart = t.DepthChart;
Console.WriteLine(depthChart);
[/code]
Method 2: prints out the entire depth chart, not just the starter.
[code]
foreach (PlayerPosition pos in Enum.GetValues(typeof(PlayerPosition)))
{
Console.Write(pos.ToString() + ':');
depthChart[(int)pos].ForEach(p => Console.Write(' ' + p.lastName));
Console.WriteLine();
}
[/code]
For method 1, I get on the console readout: System.Collections.Generic.List`1[FranchiseSim.Player][]
For method 2, I get on the console readout only the proper position strings (like QB, RB, etc.) and the colon ( but nothing from the depth chart.
|
|
|
|
|
Hi All,
I did raise this question yesterday also, but its not showing up in the message board, thus pasting it again.
I have a DataGridView where in I am trying to add DataGridViewComboBoxColumn. Though the column is getting added but the combobox is empty.
<br />
DataGridViewComboBoxCell cell = new DataGridViewComboBoxCell();<br />
cell.Items.Add("One");<br />
cell.Items.Add("Two");<br />
cell.Items.Add("Three");<br />
DataGridViewComboBoxColumn column = new DataGridViewComboBoxColumn();<br />
column.HeaderText = "SELECT";<br />
column.Name = "ItemSelect";<br />
column.CellTemplate = cell;<br />
column.DropDownWidth = 160;<br />
column.Width = 90;<br />
column.MaxDropDownItems = 3;<br />
column.FlatStyle = FlatStyle.Flat;<br />
column.ReadOnly = true;<br />
myDataGridView.Columns.Insert(0, column);<br />
After displaying the values which event I should handle to get the selected value in combobox?
Thanks in Advance
|
|
|
|
|
Hi All,
I have rows and columns of rectangles which act as a rack system. Please see the attached picture.
http://i446.photobucket.com/albums/qq185/toe_toe7/C%20Sharp/test.jpg[^]
What I am trying to do now is as follow:
1. Left click to select single rectangle
2. Ctrl+Left click to select multiple rectangles one by one
3. Drag and create a boundary to select multiple rectangles within the boundary.
And after selecting, I would need to return the selected rectangles value.
I was told to use ILOG but I just wonder if it could be done without it.
Thanks in advance..
|
|
|
|
|
Your best bet is to keep an array of rectangles to draw, draw them in your paint event, and as you drag a box, iterate over your collection of boxes and work out which ones are inside that box, and mark them accordingly
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|