|
It's a slow afternoon here and I seem to recall a Lounge rant against rude responders where you were given a hard time. It struck me a hilarious to see you attempting to spoon feed this person.
If I have you mixed up then I apologise but the rant and some of the reactions (Chris's reply sticky) has modified my response pattern, I now have to wait for some idiot to post a programming question in the Lounge to vent my sarcasm on.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi MyCroft,
Yep, you got me mixed up with someone else; I was the author of a strongly worded post[^] on the Site forum stating I believed people were frequently using requests for help to "take a dump on" posters on the technical forums, and this was hurting CodeProject, and was (is) just nasty pieces of work with no redeeming value.
Chris came out with the new guidelines soon after my post : of course, however, I do not believe my post was the "cause" of acton by Chris : I think he was hearing from many people on this same issue.
Don't you remember when you were a "newbie" in some technical arena, and you really didn't want someone to write your code for you, but you did need some pointing to what was really important to focus on so that you developed your understanding, were enabled to solve many problems, rather than just get a "quick fix" for a specific case you were not making progress with ?
When people have kindly replied to me here with helpful pointers when I have been stuck, I've always experienced that as "helpful enabling," not "spoon-feeding."
As I said in my long post on the Site forum : I'd like to see CodeProject, my favorite site in the whole world , my faithful old friend, my galaxy of revered gurus and teachers, have the same dynamic, evolving, kind of "tsunami" of sharing and interaction around problem solving for programmers that I see over on StackOverflow.
imho we can contribute to that partially by getting our jollies at our own expense rather than using people we don't know many of whom may not be "native" English speakers.
Let us, my friend, disprove the theory of humour espoused in the play "Comedians" by Joe Orton where he has the protagonist say, at one point : "the essence of humour is somebody else gets hurt."
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
I have managed to make use of the DwmExtendFrameIntoClientArea in Vista/7 to extend the glass effect into a form. However I cannot get this to happen on a form which is set as an mdi container. The glass portion just doesn't draw any more - it appears white. Note I'm not talking about the children inside the mdi parent, but on the actual main form itself.
Does anyone have any suggestions on how to get this working?
|
|
|
|
|
Anyone ever tried to get additional areas of glass on an mdi form?
|
|
|
|
|
Can anybody provide me links to a detail example about windows datagridview in .net 2005.
I m in urgent need of it
Thanx in adv
Shailesh
|
|
|
|
|
Have you tried the sample that MSDN[^] provides? There are also some handy "How to" links on the bottom of that page
|
|
|
|
|
|
Hello All,
Is there a way to change the background color of single word in textbox. I know it can be done in richtextbox, but i am looking for textbox.
Thanks
|
|
|
|
|
No way. Use RTB.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
RTB is heavy for my scenario, i was thinking whether can be done by overriding OnPaint/WndProc?
Thanks
modified on Wednesday, July 22, 2009 6:19 PM
|
|
|
|
|
You can paint anything you want on any Control you choose, so the Form itself, or a Panel, would be fine. Why still use a Label if it doesn't do what you want? You still need to tell it somehow which parts need which colors.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I am able to accomplish this with following code. But the problem i am facing is, when i select the text the drawn string is vanishing and the string is back to unformatted with no background color. Any ideas whats going on?
<br />
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)<br />
{<br />
<br />
Rectangle rect = new Rectangle();<br />
rect.Y = this.Bounds.Y + 2;<br />
rect.Height = this.Bounds.Height - 5;<br />
<br />
string str = this.Text;<br />
int index = this.Text.IndexOf("test1");<br />
<br />
<br />
string sBefore = str.Substring(0, index);<br />
string sWord = str.Substring(index, 5);<br />
<br />
Graphics g = this.CreateGraphics();<br />
<br />
Size s1 = TextRenderer.MeasureText(e.Graphics, sBefore, this.Font, this.Bounds.Size);<br />
Size s2 = TextRenderer.MeasureText(e.Graphics, sWord, this.Font, this.Bounds.Size);<br />
<br />
<br />
if (s1.Width > 5)<br />
{<br />
rect.X = this.Bounds.X + s1.Width - 5;<br />
rect.Width = s2.Width - 6;<br />
}<br />
else<br />
{<br />
rect.X = this.Bounds.X + 2;<br />
rect.Width = s2.Width - 6;<br />
}<br />
<br />
<br />
SolidBrush hl_brush;<br />
hl_brush = new SolidBrush(Color.Yellow);<br />
<br />
e.Graphics.FillRectangle(hl_brush, rect);<br />
e.Graphics.DrawString(this.Text, this.Font, new SolidBrush(Color.Black), (Width - Size.Width) / 2, 0);<br />
<br />
hl_brush.Dispose();<br />
base.OnPaint(e);<br />
}<br />
Thanks.
|
|
|
|
|
What do you think base.OnPaint(e); would do for a Label?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
text should be selectable.
|
|
|
|
|
I don't think OnPaint() contributes to selection.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
You can't do this in the TextBox control. However, you could create your own control that derives from TextBox and override the Paint method to do whatever you wish. Of course you'd have to come up with some way of specifying which word(s) have different colour backgrounds. Seems like a lot of work when RichTextBox already does this.
while (e) { Coyote(); }
|
|
|
|
|
in propertygrid having name property .. How to restrict user only type in name property maximum 50 characters.. how to do this..always user is enter only 50 character ..after enter 51 character don't allow to typing..
This is the code i am adding Item in propertygrid..
<Category("Misc")> <Browsable(True)> <DisplayName("(Name)")> <Description("Indicates the name of the control to identify on the page")> _
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
Thanks..
modified on Wednesday, July 22, 2009 6:46 AM
|
|
|
|
|
Hi
I have written a small UserControl that, at the moment, only overrides the OnPaint event without anything else. However, the content I am drawing in the control is sometimes larger than the display-area itself, so I want to implement scrollbar-functionality that allows the user to scroll if the content does not fit the screen.
I have googled a bit for this topic, but can not find any good information, and my book only tells me how to draw UserControls, not how to implement scrollbars. Any ideas where I can get started with this?
Appreciate any help
|
|
|
|
|
Hello.
1) Put your UserControl in a new Panel .
2) Set the AutoScroll property of the Panel to "true".
Enjoy
|
|
|
|
|
i need code for retreving user DSN's which are created in system
|
|
|
|
|
C# desktop application will not start when using non-administrative user. Suspect permissions issue, but cannot pinpoint. Please help. Appears to be related to .jpg background image on main form. Here is the start of the error received (cannot reproduce in IDE, so cannot cut and paste):
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Dll was not found.
at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
at System.Drawing.SafeNativeMethods.Gdip.Initialize()
at System.Drawing.SafeNativeMethods.Gdip..cctor()
--- End of inner exception stack trace ---
<snip>
at applicationName.Properties.Resources.get_background()
at applicationName.frmMain.InitializeComponenet()
at applicationname.frmMain..ctor()
at applicationName.Program.Main()
Have resinstalled .Net framework 3.5 and set full folder and file permissions available to all users on the .net framework folders as well as to our application folder, to no avail.
Any suggestions would be greatly appreciated.
|
|
|
|
|
i have created function in class file.
Public Shared Function dsCntrctET() As DataSet
Dim sqlCntrct As String = "Select * from CNTRCT_ET where CNTRCT_ID=" & CISCNO
Dim cmdCISContract As New OracleCommand
Dim daCISCntrct As New OracleDataAdapter
Dim dsCISCntrct As New DataSet
Dim cmdCISBuilder As New OracleCommandBuilder
Try
With cmdCISContract
.Transaction = myTransCIS
.CommandText = sqlCntrct
.Connection = cnCIS
End With
daCISCntrct = New OracleDataAdapter(cmdCISContract)
daCISCntrct.FillSchema(dsCISCntrct, SchemaType.Source)
cmdCISBuilder = New OracleCommandBuilder(daCISCntrct)
With daCISCntrct
.TableMappings.Add("Table", "CNTRCT_ET")
.Fill(dsCISCntrct)
.SelectCommand = cmdCISContract
.InsertCommand = cmdCISBuilder.GetInsertCommand
.UpdateCommand = cmdCISBuilder.GetUpdateCommand
.DeleteCommand = cmdCISBuilder.GetDeleteCommand
End With
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Return (dsCISCntrct)
End Function
it returns dataset that i can use for getting value from table.
but while saving data, i have to use dataadapter for da.update(ds,"table") and ds.acceptchanges.
this i have to use in multiple forms as this data comes from 3rd party so i dont want to write this in every form . so i thought how to return data adapter and dataset from the same function. as i wanted to use daCISCntrct and dsCISCntrct.
|
|
|
|
|
Don't cross post in multiple forums.
Have a look at out parameters.
|
|
|
|
|
I need help on how to build an sms web portal for e-evegenlism, for my church,please i need the source code.
Thanks
|
|
|
|
|
abbah wrote: please i need the source code.
Ummm...it doesn't work that way. This is part where YOU write the code. We'll help when you run into a specific problem. But, noone is going to write your code for you.
|
|
|
|