|
Yes, I did. The compiler didn't like it because that class is internal . Same error that if I try to derive from that class.
For the moment, I don't have the designer attribute, and it seems to work fine (if I add the control manually, the regular tab control designer is used.)
Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Well, i didn't do anything, but: You're Welcome!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Hey there, I'm currently trying out a multiple monitor setup, and for the most part I like the results. The one issue I'm having at this point is when running a full screen application on one monitor, I can't effectively use any other monitor. One of the following two things happens:
A) I can move the mouse to the other monitor(s) but upon clicking, the fullscreen application loses focus and minimizes
B) I cannot move the mouse away from the full screen application
For the most part B is not a problem, but I would like to be able to set a hot-key to switch focus away from the application without minimizing it.
So, it seems fairly obvious that I need to intercept and discard the focus lost message to fix A, and maybe set up a hotkey to provide alt-tab like functionality, again preventing focus loss, to fix B. Unfortunately my message handling experience is limited and c++ based, and I'd like to do this in C#.
Does anyone know if something like this exists already? If not, I'd appreciate a push in the right direction to do it myself.
Thanks!
Dave Miller
|
|
|
|
|
Do those problems occur with every app, or only with games?
I've got 2 moitors, and i can swap programs and move my mouse when-/wherever i want, as long as i'm not playing some (DirectX ?) game.
Sorry i can't help you any further...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
It is usually games that cause problems, but I'm sure there are exceptions.
|
|
|
|
|
Well, then i don't know anything too...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
How can I pass value from WindowForm to another WindowForm like click ok button in form1 and fill data in listview of form2. I try to use public modifier but it doesn't work. Thank you.
Ps. I use modal form.
|
|
|
|
|
This often comes up in the forum among object-orientation beginners. I suggest you search the forum. Basically, pass your Form1 instance to Form2, then in form2, call form1Instance.SomePublicValue to get to the value.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
The best way is to pass only the data needed to the second form before calling ShowDialog through a public property.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
Anyone know how to convert a Julian type date (example: 05189 - Format YYDDD) to a current DateTime using C#.
Thanks
|
|
|
|
|
Create a DateTime structure from the year and add the number of days less one:
new DateTime(2000 + 5, 1, 1).AddDays(189 - 1)
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I'm writing a little TabControl derivative to provide a SelectedIndexChanging event. I would like to add designer-support. I currently can create the object in the designer, but I have to implement a lot of code in the TabControlDesigner internal class (in System.Design.dll, see with .NET Reflector.)
Since it's basically a normal TabControl , I would like to avoid all the work and just use the same designer support, but the class is marked internal, so I can't specify it in the Designer attribute.
Is there a way (using reflection for example) to use this class as my designer?
[EDIT: Actually I don't need to derive from it. If I could specify it in the Designer attribute, it would be enough.]
Thanks,
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hey, i need to BOLD some words inside a string that is part of a smtpmail body.
Here is my string:
string Message_body1="User password reset " +usename +"\r\n \r\n \r\n Login information for this user has been reset. \r\n \r\n login id:" +UserName ;
I want to bold "login id:"
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
In a plain-text email, you can't. If it's an HTML email, just use the appropiate tags.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
yah, plain text.... thanks
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
You have simply to set the message type to html (MailMessage.BodyFormat = MailFormat.Html), then use html tags. To bold a word, just write: <b>your word</b>.
|
|
|
|
|
yah, but can i do that from a win form? not working on a web form
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
if you use a RichTextBox instead of a Label or TextBox, yes.
if the word you have to bold starts at position 12 (char 12) and it is long 10 chars, do that:
int oldPos = richTextBox1.SelectionStart;
richTextBox1.SelectionStart = 12;
richTextBox1.SelectionLength = 10;
richTextBox1.SelectionFont = new Font(richTextBox1.SelectionFont, FontStyle.Bold);
richTextBox1.SelectionStart = oldPos;
richTextBox1.SelectionLength = 0;
richTextBox1.ScrollToCaret();
Note that oldPos is used only for restoring the old position of the blinking cursor. do that only if you need it.
I don't know any other valid way in WinForms...
|
|
|
|
|
well, sorry I didn't explain myself well... I'm using smtpMail from withing the code, no input from the user except the email address.
But none the less I was stuck in the mindset of a single line of code for the smtpmail method and forgot that if i was to declare everything with MailMessage that I could use it as MailFormat.Html, so I figgured it out.
Thanks for the memory jolt!
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
I'm creating a page with a ton of chk boxes and instead of writing out a switch or if, if, if...
is there a way to loop through them using IEnumerator ien = Panel1.controls.getEnumerator() and process only controls of a given (Check Boxes) type? I can't seem to make it work.
Thank you in advance,
Jake Holt
|
|
|
|
|
Yes.
foreach(Control ctl in panel1.Controls)
{
CheckBox chk = ctl as CheckBox;
if(chk == null)
continue;
} The as operator will make the cast if possible or return null. There's also is , but that would require two statements:
if(ctl is CheckBox)
{
CheckBox chk = (CheckBox) ctl;
...
} I hope this helps!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Works perfectly, thank you
Jake
j
|
|
|
|
|
You're welcome, I'm glad I could help
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Ok, I was really suprised at how fast this was processing using the collection versus the way I was doing it before, so naturally I decided to chop out more lines of code and put all my panels inside another panel and went about processing only the panel controls (the panels that contained the check boxes). Oddly though it only seems to find/process the last panel of three. Any ideas what would cause this?
<br />
foreach(Control ctrl in mainPanel.Controls)<br />
{<br />
Panel p = ctrl as Panel;<br />
if(p == null) continue;<br />
else<br />
{<br />
foreach(Control ctl in p.Controls)<br />
{<br />
CheckBox chk = ctl as CheckBox;<br />
if(chk == null) continue;<br />
else<br />
{<br />
if(chk.Text == "Check All" || chk.Text == "Uncheck All") continue;<br />
else<br />
{<br />
if(chk.Checked)<br />
{<br />
sql += " " + chk.Text + "=1,";<br />
}<br />
else<br />
{<br />
sql += " " + chk.Text + "=0,";<br />
}<br />
}<br />
}<br />
}<br />
}<br />
}
Thanks again, Jake
|
|
|
|
|
Seeing that you want to reduce the number of lines, I reformatted your code:
foreach(Control ctrl in mainPanel.Controls)
{
Panel p = ctrl as Panel;
if(p == null)
continue;
foreach(Control ctl in p.Controls)
{
CheckBox chk = ctl as CheckBox;
if(chk == null)
continue;
if(chk.Text == "Check All" || chk.Text == "Uncheck All")
continue;
if(chk.Checked)
{
sql += " " + chk.Text + "=1,";
}
else
{
sql += " " + chk.Text + "=0,";
}
}
} Basically, continue continues the cycle, so you don't need to do the else (and the extra braces and indenting.)
You're code looks fine. Have you stepped through it in the debugger? See what mainPanel.Control contains. Maybe your two other panels are siblings to mainPanel , or grandchildren of mainPanel .
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|