|
Dig further; there are TONS of places, including here, that show you how to hard code this stuff.
"Well, we're getting "F"'d at work. WPF, WCF, and WWF... WTF?" --John Simmons
|
|
|
|
|
Hi.
In my app I have a ListView (in Detail view) with owner drawn items/subitems. It works fine except when the user double clicks the vertical line between the column headers to resize the column. The column width becomes all wrong. So I need some way to give autoresize the width of the subitems, but I haven't found any. The only solution I have thought of is to catch a double click on the headers and handle the resize myself, but since the double click event is not sent for column clicks this solution will be messy. So, does anyone know a less ugly solution to this problem?
modified on Wednesday, January 14, 2009 3:28 PM
|
|
|
|
|
Hello
I new to Programming so please bare with me
I am trying to write a Theatre Booking system in C# but I hit a slight problem.
The Problem is that the seating argument that is used in the theatre has Row A-H with 15 seats and J-P with 18 seats. On The form there is a separate Box for row letter and a separate box seat number When the Operator selects a seat location eg (A5) I want to be able to run a check on it to see whether it is valid. For example seat A5 would return no value because it is a possible combination as for A17 I want it to return a value “Seat Not Possible”. How do I go about this?
I thought of using a statement like [ “If (TB1 <= 7 & TB2 < = 15) Return Message “Seat Choice Valid” else Return Message “Invalid Choice of seats” // “If (TB1 >= 7 & TB2 <= 18 Return Message “Seat Choice Valid” else Return Message “Invalid Choice of seats” ]. Would this work ?
Problem Here is I than need to assign all the row letters to number for example A=1, B=2, C=3 ect How would I do this, could I use an array to assign Values or can I use multiple If statements. I thought about using an If statement similar too [ “IF (TB1 = A) do A = 1;” // “else If (TB1 = B) do B = 2” // else “IF (TB1 = C) do C = 3;” // “else If (TB1 = D) do D = 4” ect ]. Would this work ?
I would appreciate any help on this matter as I have come to a dead end.
|
|
|
|
|
tswright1041 wrote: [ “IF (TB1 = A) do A = 1;” // “else If (TB1 = B) do B = 2” // else “IF (TB1 = C) do C = 3;” // “else If (TB1 = D) do D = 4” ect ].
I'm going to say no because that would be an assignment operator not a comparator operator, use == this isn't VB
|
|
|
|
|
I think the ideal solution here is to not give them the ability to choose an invalid seat combination in the first place. Something like a dropdown that has the Box Rows and a dynamic dropdown for the Box Seats that only populates with valid seat numbers.
|
|
|
|
|
Or have a Dictionary<char,Hashset<int>>
if ( dic [ row ].Contains [ number ] ) ...
|
|
|
|
|
Technically speaking, what your asking about is an algorithm. If you think about it purely analytically, you basically have these rules (I assume, I could have interperated your question incorrectly):
Available Rows: A - P
Available Seats: 1 - 18
Rule: Row between A and H, Seat geater than 15 = invalid
Rule: One assignment per Row/Seat combination
If your creating a booking system, the ultimate result of a booking is that you track which row/seat is assigned somewhere (in my example, a dictionary mapping a key(the row) to a list of ints (the seats):
class TheaterBooking
{
const char MAX_ROW = 'P';
const int MAX_SEAT = 18;
IDictionary<char,IList<int>> m_bookedSeats;
public TheaterBooking()
{
m_bookedSeats = new Dictionary<char,IList<int>>();
}
public bool IsValidNewBooking(char row, int seat)
{
if (row > MAX_ROW) throw new ArgumentException("Invalid row specified.", row);
if (seat > MAX_SEAT) throw new ArgumentException("Invalid seat number specified.", seat);
if (!IsValidSeat(row, seat))
return false;
if (IsAlreadyBooked(row, seat))
return false;
return true;
}
private bool IsValidSeat(char row, int seat)
{
if (row <= 'H' && seat > 15)
return false;
return true;
}
private bool IsAlreadyBooked(char row, int seat)
{
IList<int> filledSeats;
if (m_bookedSeats.TryGetValue(row, out filledSeats))
{
if (filledSeats.Contains(seat))
return false;
}
return true;
}
}
modified on Tuesday, January 13, 2009 8:44 PM
|
|
|
|
|
I added the code that you kindly sent to me to my project. But How dose it no witch seats are booked. I guess there must be some code like DictionaryName.Add (Var1,Var2 ); But Some how you need to declare the Keys and Ints. Were Var 1 is the key and Var 2 is Ints. Can you help?
|
|
|
|
|
The rest of the application is up to you. You would probably need to add a new method called BookSeat(char row, int seat) that first checks if the seat is valid, and if it is, adds a booking. The algorithm for that you have to figure out...as a programmer, thats your job. You have a huge head start because of what I gave you...learn from it, be creative, and finish the code on your own.
|
|
|
|
|
I need to start a C# .Net application (actually a windows form app) when Internet Explorer received a specific file, and that application needs to read the file content. In other words, IE receives a file containing data with an extension of .vdl and I set up .vdl file association to open my application readvdl.exe.How does my application read the content of the file received and passed on by Internet Explorer?
|
|
|
|
|
FileStream with path passed in string[] args I would imagine.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thank you, I know it was a simple thing but I didn't really know how it worked.
|
|
|
|
|
Hi,
I'm uasing "Shared Add-in Support Update for Microsoft .Net Framework 2.0 KB908002" as pre-requesites to load some Office plug-ins. I want to know whether this plug-in has been already installed or not? So far i couldnt find proper registry entry also.. Can some one tell me?
Thanks.
|
|
|
|
|
How does C# comes into play? You want to write a code for it?
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
I have written the form in C# and I needed to know how to read the file sent via IE. Dave answered my question - IE sends you the temp file path as an arg and I can read it from there.
|
|
|
|
|
I seriously think that he wants to write a C# code to detect plug-ins in the windows registry, look bro, thts simple, do u know how to use google..........start from scratch and someone will help u out if u r struck.........we dont provide ready made solutions.........do ur homework first.......
|
|
|
|
|
Not at all, bro. I do know how to use google, bro. I used google extensively, bro, when searching for this, bro. I guess, bro I need to work on my search skills, bro. And I wasn't asking for ready made solutions. Read Dave's post above, that's all I needed. Yeah I know, simple huh bro? Cheers and thanks to Dave.
|
|
|
|
|
Hi guys!
Im trying to detect when a user "kills" my c# app using windows task
manager(so i can prevent it), i've tried with the form events _closing and _closed managing but it won't satisfy me
any one got any idea?
tancs
|
|
|
|
|
Yeah, you can try giving up, quitting or obtaining common sense.
|
|
|
|
|
what do u mean? what are those programs working like some of antiviruses that doesn't allow users to kill them from taskmanager?
|
|
|
|
|
Their called services
only two letters away from being an asset
|
|
|
|
|
so there is a solution, but if u know where should i start?
|
|
|
|
|
They never researched how to "share" keyboards and mouses in their "office"
Stop trying, you lose.
|
|
|
|
|
Those are all utilities that come with Windows. I think they're in the GetAFuckinClue folder.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Watch the language, please. Inappropriate and unhelpful.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|