|
You cannot set the color unless you remove the line Application.EnableVisualStyles(); from the main file.
This line enables the default windows color on your application.
Note that removing this line will have an impact on the entire form.
|
|
|
|
|
superselector wrote: Why From the documentation[^];ForeColor and BackColor changes for the ProgressBar will not be honored when visual styles are enabled on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and above.
You'd could paint your own progressbar, or try one the articles here on CodeProject.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I got an error when calling a secure(query string url) connection from c# code .any one got the same issue please help me.
issue : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
code :
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse webresponse = (HttpWebResponse)request.GetResponse();
request.Accept = "text/plain";
StreamReader responseStreamReader = new StreamReader(webresponse.GetResponseStream());
string response = responseStreamReader.ReadToEnd();
Thanks,
Shinu K
|
|
|
|
|
Make sure you are connecting to the url as https and not http.
|
|
|
|
|
C# vs Delphi. any ideas?
I am looking for few ideas & comments using the above technologies in,
- web based application,
- Large(which is good for future development)
- Faster(I guess Delphi)
- The development environment
|
|
|
|
|
There are even more facets to this.
For e.g.
It depends not only on your skill set but of the team you are planning to deploy.
I guess finding C# resources are better than Delhpi.
I would assume C# has a better development environment.
|
|
|
|
|
Swinkaran wrote: C# vs Delphi. any ideas? That's like meat vs. cheese on a sandwich.
Swinkaran wrote: - web based application ASP.NET would be the most widely used; meaning it's easy to get devs that are familiar with it and that there's quite some documentation.
Swinkaran wrote: - Large(which is good for future development) What is "large" in your opinion? Does it generate a huge executable? Consist of multiple projects?
Swinkaran wrote: - Faster(I guess Delphi) In converting ints and adding them to a list, yes; Delphi would be faster. C# has a better overall performance, due to things like thread-pooling.
Swinkaran wrote: - The development environment I enjoy the VS2012 IDE; haven't seen the Delphi IDE since v6.
FWIW; it's allowed to mix both languages - I'd recommend using .NET, and to plug in your Delphi-code when you find that you "need more speed" or want to juggle with pointers.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi All !
The Event of btnNext_Click in DataGridView here is my Code :
int numOfRows = dgv.Rows.Count - 1;
int index = dgv.CurrentRow.Index;
if (index < numOfRows)
dgv.CurrentCell = dgv[0, index + 1];
else
dgv.CurrentCell = dgv[0, index];
the problem is I want to use :
dgv.CurrentRow=...
to Select Current Row .the property of CurrentCell active One Cell of Current Row.
Thanks
|
|
|
|
|
I'm not sure you'll get much help on this until you write in complete sentences and explain what the problem is more clearly.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
smh1392 wrote: the problem is I want to use : That's indeed a problem; that property is readonly, meaning you cannot set it. You can set the current row by selecting it using the CurrentCel property, like shown below;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
class Program
{
static void Main(string[] args)
{
using (var f = new Form())
{
var dgv = new DataGridView() { Dock = DockStyle.Fill };
var lst = new List<Object[]>();
lst.Add(new object[] { 1, "One", DateTime.Now });
lst.Add(new object[] { 2, "Two", DateTime.Now });
lst.Add(new object[] { 3, "Tee", DateTime.Now });
dgv.DataSource = lst;
f.Controls.Add(dgv);
var btn = new Button() { Dock = DockStyle.Top };
btn.Click += delegate
{
dgv.CurrentCell = dgv[1, 1];
};
f.Controls.Add(btn);
f.ShowDialog();
}
}
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hi
how to create wordlist 8 to 16 character contain full character on the keyboard ??
|
|
|
|
|
Probably by writing some code. But you need to give a much clearer explanation of your problem if you want some help.
Veni, vidi, abiit domum
|
|
|
|
|
mory_260 wrote: how to create wordlist For which purpose? If you're looking for something that generates passwords, try a "normal" dictionary and specific character-replacements.
mory_260 wrote: contain full character on the keyboard A key on the keyboard is usually responsible for more than one type of character. One can even type characters that aren't present on the keyboard, using an alt-numeric combination or an application like Windows' charmap.
With strings containing UTF16 characters, there's quite some more characters than keys
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi there !
I want to not allow at Space the First of TextBox Like this :
TextBoxText=" Test";
in key_Pressed event i wrote this :
if ((sender as TextBox).SelectionStart == 0)
e.Handled = (e.KeyChar == (char)Keys.Space);
else
e.Handled = false;
but it doesn't work .
thanks any help .
|
|
|
|
|
Well, you never specified where this code was, so I'll assume it's in the code for the form. That;s the wrong place to put it. Normally you would put code like this in a class that inherits from TextBox and create your own version of the TextBox to use. Then this code would go into the KeyPressed event handler of this new class.
|
|
|
|
|
Let the KeyPress event execute - just trim the textbox e.g.
(sender as TextBox).Trim()
|
|
|
|
|
Almost, it would have to be:
(sender as TextBox).Text = (sender as TextBox).Text.Trim();
But you would also have to check that .Text is not empty or null first.
|
|
|
|
|
|
Abhinav S wrote: just trim the textbox My esteemed colleague, Abhinav,
Using 'Trim you are giving away a free gluteoplasty with every KeyPress ! Marketing is going to hate that.
bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
Not a good idea. What happens if you want to put a space in a word as you type?
|
|
|
|
|
Please post specific coding questions, like this one, in the Q&A forum, thanks.
Since (to the best of my knowledge) you cannot now delete this question here, and repost it in Q&A, I'll respond.
First, if you want to create a re-usable TextBox because: you want to use many TextBoxes that behave like this; my esteemed colleague Dave K. is absolutely right when he advises you to make a TextBox Control Class that inherits from Windows Forms TextBox.
If you don't know how to effectively sub-class WinForms Controls, please research Codeproject, the VS 201#x documentation, and MSDN, for information on creating your own Components, or UserControls. If you have problems with understanding, or implementing, them: ask them here on Q&A.
Here's some sample code that just modifies the behavior of one specific TextBox, 'textBox1:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (textBox1.SelectionStart == 0)
{
if
(Char.IsWhiteSpace(e.KeyChar))
{
e.Handled = true;
}
}
}
Note: that you don't need to explicitly set e.Handled to 'false because 'false is the default value.
If you only want to suppress the space-character, and you want to allow tabs, or cr/lf's to be typed at position #0 in the TextBpx: then change the code above.
And, something you might think about: what happens if the user pastes text in, at position #0 in the TextBox, and the pasted-in content begins with spaces, tabs, etc. ? Try that, using the code above, and observe
Resources you should review: [^],[^],[^].
bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
thanks
|
|
|
|
|
Bill, there is no reason that this question is not suitable for this forum.
|
|
|
|
|
Pete O'Hanlon wrote: Bill, there is no reason that this question is not suitable for this forum. Hi Pete,
I must, respectfully, disagree: this is a language-specific "general programming" forum; the design of CodeProject (originally, anyway), for a good reason, had both a C# Q&A forum, as well as this "general programming" forum.
I am sure the intent of having two types of Forums, with two very different facilities ... one having formatting-free back-and-forth commenting, and a whole different voting structure with a range of scoring levels, and a way for the user to "accept" a given answer, and the other operating like all the other non Q&A forums ... was to have a place where, on the one hand, there could be substantive discussions of broader aspects of the use of the C# language, or, more advanced problems in programming that involved advanced concepts in C#. (this forum), and the other (Q&A): a place for specific programming questions of the "how do I ?," "how can I ?," "I'm stuck trying to" forms.
In practice, however, this forum has become a place where there is a creep-in of the type of questions that are best-suited for Q&A.
The analogy I'd use is: once a master-gardener designed two adjacent gardens, for very different purposes. One garden was intended for rare plants that needed special care, and where gardeners could meet to have educational discussions about the best gardening practices in taking care of both ordinary, and the "rare" plants.
The other garden was designed for common plants, plants for which gardening was a simple matter, and a place where those beginning to garden came to learn the basics of gardening, by hands-on practice, and having the opportunity to work alongside more experienced gardeners.
Using this analogy, I would say that, now: the strong hedge-row between the two gardens has collapsed, and many of the rare plants have stopped their rare blossoming, and both gardens are over-run with weeds and gardeners-gone-starkers who claim to be virtual incarnations of the original gardener, themselves, and run virtual 24-hour radio-stations broadcasting their grandiosities
Isn't the "downfall" of Q&A reflected clearly in your own admission on CP (sone time ago), that you withdrew from participating in Q&A, yourself, because you were uncomfortable with what was happening there ?
It's fine with me if CM changes the whole structure around. It's quite possible the time has come for that (?).
But, I feel it's entirely legitimate, and not disrespectful, to suggest to posters on this forum that their type of post is best-served, for both them, and CP, as a whole, on Q&A.
yours, Bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
You do know that the QA forum is relatively new don't you? For years, this forum did the job perfectly well. The intent of this forum was always intended to be the back and forth, as was best suited to by a forum format, where the thread can build out the answer.
|
|
|
|
|