|
Eman,
I just hacked this code out of my own C# project, hoping thatit will be of use to you. It may help clarify a few quirky things about PathGradientBrush. I think, by altering the focus parameter of SetTriangle... or SetSigma... in the code below, that you may be able to present a highlite at a position in a circle which approximates the look of a sphere. I honestly dont think you will get anything high quality though without breaking the sphere into triangles and shading each one appropriately, and that's way beyond me.
Another kludge you might use is to take a bitmap of a sphere, drawn in a 3D package or using Photopaint etc., and scaling it.
Well, for what its worth, here is my code, you will have to hack out my variables and try follow what's going on quite closely.
This method returns a brush that you can use on Graphics.FillPath.
prPath is a GraphicsPath
prFlip just flips a start and end color around
prBrushType is my enumeration which controls whether blends or triangle or bell type fills
public PathGradientBrush CreatePathBrush(GraphicsPath prPath)
{
Color lStart, lEnd; // Start and end color
PathGradientBrush lBrush; // Brush to assign to
lStart = Your Start Color;
lEnd = Your End Color;
// Create the linear brush
lBrush = new PathGradientBrush(prPath);
lBrush.CenterColor = lEnd;
// Create an array of colors which are the end color at each point
Color []lColors = new Color[prPath.PointCount];
for(int lCount = 0 ; lCount < prPath.PointCount ; lCount ++)
{
lColors[lCount] = lStart;
}
lBrush.SurroundColors = lColors;
// Experiment with the 0.5F figure, it should change the highlight on the shape you fill
// Of course you will want to fill a circle or ellipse would be better still.
lBrush.SetSigmaBellShape(0.5F);
return lBrush;
}
---------------
Hope this makes some kind of sense to you.
Nursey
|
|
|
|
|
Hi cnurse
thanks for the help buddy.
i have now my concept bcome bit improve about the path gradiant brush.
Thanks for your help.
|
|
|
|
|
You're very welcome. I'm glad I can offer back to a system I have gained so much from.
By the way. Watch out for my Theme system which will be released in the next few weeks. It lets you edit and manage gradients and will show you lots of ways to use them.
Regards,
Nursey
|
|
|
|
|
How can i make connection between optionbuttons and recordsets?
|
|
|
|
|
|
Hi..
I have created 3 different application.out of 3 ,one is taking care of "sales automation",second is "sales account" and last application is taking care of all MASTERS .so i want implement this in one deployment package.for example in oreder to implement in client side ,i would require a check box along with all this application name,where i can select which app is require and which is not require.so it would be easier for me to select app name accroding to users requirement.ex:an administartor might require all the application where as a normal user require only "Sales Automation" part,and a account person might require "Sales Account" part.In order to differentiate and implement i require all the application in a single deployment package other than having different 3 deployment package.
If any one know this ,please help me
Thanxs in Advance
|
|
|
|
|
I am just beginning serialization on .NET, having dealt with it many times before with other systems. I have been told serialization using the XML serializer is simple, and the documentation makes it appear so. But, do I have to make all my properties public? I create accessors for all properties, as its easier to debug things that way, and some of my properties are read-only. I can't go making my internal member variables public, that would be crazy, so what do you do about it?
(By the way, if you don't think it is crazy to make your member variables public, then how would you do range checking and protect yourself against corrupted data on de-serialization?)
I'm about to start writing my own serialization code for each class, so a quick guide would be really appreciated.
I don't care if its XML or binary format, I guess there's really not much difference from a coding point of view anyway.
Many thanks, and a Happy New Year to all.
Nursey
|
|
|
|
|
Can anyone tell me either API calls or VB.NET code to do the follow steps or items.
1. Start Windows Explorer. (ProcID = Shell("C:\Winnt\explorer.exe))
2. Size Window Explorer and set it's position.
3. Set Initial Folder.
4. Set Filter on files shown. (Not a must but would be nice.)
5. Recieve Event or know they have closed Window explorer with my ProcID.
Any assistance would be great.
Thanks
Don
Don Hamilton
VantageMed Corporation - Kansas City
|
|
|
|
|
hmm interop with internet explorer to create InternetExplorer object or
1) System.Diagnostics.Process.Create(...)
then API i suppose
2) FindWindow to find the window, and some other function to change the windows position SetWindowPos i think
3) is a command line switch
4) don't know
5) Process.Create returns a process object which, when the appropraite property is set, raises the Exit event
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
... and get special folders (windows folder) from System.Environment if you can't make it working by setting the filename to "explorer"
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
It seems there is a way to wrap text for a datagrid in .ASP and there is a way to wrap a header of a column.
Does anybody know is there is a VB.NET way to wrap text in a column?
Thanks,
cb
|
|
|
|
|
I also need this functionality. I've written a custom word wrap function, but the height of each row doesn't grow to show the wrapped text. This seems to be a real nightmare!
Don't worry, nobody lives forever.
|
|
|
|
|
It would appear that the best way tp do this would be to create a custom column class. Could anyone who's done this offer some help? I have a function that will do the word wrap based on a given width, font, and graphics object.
Don't worry, nobody lives forever.
|
|
|
|
|
Hi
I wrote a custom column style. The style only allows viewing, not editing. (Time is money, and money is something my client doesn't like parting with.)
The main problem is that the column style needs to return the preferred, and minimum, width and height for it's contents BEFORE the paint operation takes place. I fiddled this by making a fixed height, and then the form housing the datagrid resizes the wrapped column so that the sum of the column widths equals the datagrid width.
Too much code to include here, but you get the idea. Imperfect solution for an imperfect world. (Or is the world imperfect because people like me are willing to settle for less than perfection?)
Don't worry, nobody lives forever.
|
|
|
|
|
<code>Dim writer As XmlTextWriter = _
New XmlTextWriter("..\Sample0.xml", System.Text.Encoding.UTF8)</code>
|
|
|
|
|
there is a xml file: price.xml
<price>
<comdt>
<Tname id=0>AAA</Tname>
<Tprice>0</Tprice>
</comdt>
<comdt>
<Tname id=1>BBB</Tname>
<Tprice>0</Tprice>
</comdt>
</price>
the price is null,
now I have a array,arrprice(i),
arrprice(0) is AAA's price,
arrprice(1) is BBB's price,
How to use the arrprice(i) update the xml file?
I tried this way,
For x = 0 To 1
Set objprice = objDom.SelectSingleNode("//price/comdt"&[x]&"/Tprice")
objprice.Text = arrprice(x)
but it doesn't work.
Thank you!
|
|
|
|
|
Hi! I am in WAY over my head here and was hoping someone could help me out. I need a db that is like a time clock. Employees clock in and out, time is entered into table, and reports are run to show hours worked. I have no formal training in computers, so please bear with me One of my current problems is directing the data to the login or logout field. It only enters into the login field now. My next problem is that I need to tell the user his time is entered, and then refresh the form for the next user. I tried the Docmd.OpenForm, but it opens a new form on top of the previous one, creating quite a mess! I read about loop while or loop until, but...basically I'm clueless . One more problem---it doesn't always work. I don't see the rhyme or reason, but sometimes the time is entered, sometimes not, and sometimes it is entered for ALL employees. Can anyone help me? Please be gentle, remember, I am new to this!
The set up is:
tblStaff
StaffLoginName
StaffPassword
tblLoginRecords
LogStaffLoginName
LogPasswordEntered
LogINTime <---(all times currently enter here)
LogOUTTime
LogProblem (yes/no check)
frmLogin
bound controls: Your Name [LogStaffLoginName]
Enter Password [LogPasswordEntered]
(hidden) LogTime [LogINTime]
(hidden) LogDate [LogINDate]
Log IN (cmd8)and Log OUT (cmd 9) buttons (code follows)
(hidden) yes/no check box for LogProblem
___________________________________________________________________________
Private Sub Command8_Click()
On Error GoTo Err_CmdLogin_Click
If [LogStaffLoginName] = DLookup("[StaffLoginName]", "TblStaff", "[StaffPassword]=forms!frmlogin!LogPasswordEntered") Then
MsgBox "Your time has been logged.", vbOKOnly, "Login Confirmation."
DoCmd.OpenForm "frmLogin", acNormal
Else
Me!LogProblem = -1
MsgBox "Incorrect UserName or Password. Please try again.", vbOKOnly, "Login Error."
DoCmd.OpenForm "frmLogin"
End If
Forms!frmLogin.Visible = False
Exit_CmdLogin_Click:
Exit Sub
Err_CmdLogin_Click:
MsgBox Err.Description
Resume Exit_CmdLogin_Click
End Sub
Private Sub Command9_Click()
On Error GoTo Err_CmdLogout_Click
If [LogStaffLoginName] = DLookup("[StaffLoginName]", "TblStaff", "[StaffPassword]=forms!frmlogin!LogPasswordEntered") Then
MsgBox "Your time has been logged.", vbOKOnly, "Logout Confirmation."
DoCmd.Save acTable, "[LogOUTTime]", "tblLoginRecords"
Else
Me!LogProblem = -1
MsgBox "Incorrect UserName or Password. Please try again.", vbOKOnly, "Logout Error."
DoCmd.OpenForm "frmLogin"
End If
Forms!frmLogin.Visible = False
Exit_CmdLogout_Click:
Exit Sub
Err_CmdLogout_Click:
MsgBox Err.Description
Resume Exit_CmdLogout_Click
End Sub
__________________________________________________________________________
I know it's a mess now sorry. I see that in the form there are controls w/ LogIN times, but I am just not seeing the logic and how-to to seperate these and allow for logOUT times, while tying into the two seperate buttons. I hope that all made sense, and thank you to all for your attention!
Dazed and confused~~~Tiff~~~
I have no special talents. I am only passionately curious.
--Albert Einstein
|
|
|
|
|
Hello Tiff:
I have a didn't see a field for the date in the logins table and I think that in the same table you only need the user name to link this field whit the one in the staff table, to display only one time the form you can check if its display or use modal mode on when you display the from, one question what version of VB your using?.
JA
|
|
|
|
|
Hi JA! Thank you for looking The logINTime and logOUTTime are date and time fields. I thought this would be easier for calculations. They are set as 01/01/2004 12:00 in the same field.
I am using Access 2000 w/ VB6.
I have no special talents. I am only passionately curious.
--Albert Einstein
|
|
|
|
|
HI
I want to develop an interactive .net service that creates
a notifyicon at startup, so that the user can interact
with it (e.g. a double click on the icon in the systray
shall cause the service to react). So I placed such a
control in the service class and made it handle double
click events ..... but just nothing happens! When I
doubleclick the icon in the systray the appropriate code
in the service is not called and executed!!
can anyone help me??
mosquitooth
|
|
|
|
|
Make sure the service has the option turned on that allows it to 'interract with the desktop'.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
i have problem in vb with timer control i want the miliseconds but whenever i try it by using format() function or Second(Time) function it shows the required result but the seconds are allways in 2-4-6-8 manner in 4 bit format what can be the problem how can i get the exact time on my form?
|
|
|
|
|
the timer control is not this accurate..
it can't get millisconds .. so it seems it steps 2 millisconds.
maybe you'll need to use windows timers (you'll search some APIs)
|
|
|
|
|
The Timer control doesn't have that kind of resolution. You can use 3rd party high resolution timers such as the CCRP High Performance Timer Objects. The package can be found here[^]. It was originally written for VB6, but can be used in VB.NET also.
RageInTheMachine9532
|
|
|
|
|
OK, I'm builing an app (in VB6 as I know it much more than .NET) that has only two form items. A combo box and a button. The combo box has about twenty options that the user can select and it will launch IE and take the user to the specified page. The user can also type in a fully qualified domain name and it will take them to that page.
All that works perfectly.
However, I am trying to add the ability for users to search google by typing "Google:blah" replacing blah with whatever they want to search for. The way it's working right now is that it is trying to open a webpage with the name "google:blah" and of course, IE can't find it.
I have it coded to select the first 7 characters in the text box, but can't get it to remove them and search google if the first sever characters are "Google:". Any help? I'm just not sure how to remove the selected text. I was trying the following code, but it's not working:
go = go - cboChoose.selText
'I also tried this:
go = go - cboChoose.selLength
Here's a copy of the current file so you can see what I mean.
Any help?
|
|
|
|