|
No problem.
|
|
|
|
|
I am using MS Graph Chart (MSGraph.Chart8) in an Access2007 form to represent a work schedule.
My vertical axis contains the days of the schedule (Day 1, Day 2,...) and along the horizontal are the hours of the day (00 to 24) - 24 hr segments.
If a shift starts in Day 1 at 10pm (22:00) and goes for 8 hours, it will extend into Day 2.
My question: do you know how to change the color of individual data series (bar)?
For hours that roll-over into the next day, I want to distinguish with a different color than the rest of the bars (data series) which are all same color.
Bigger question: i want to control more properties of the MS Graph Chart object so I can resize/scale my vertical axis to accomodate several labels (Days).
Thank you.
John
|
|
|
|
|
I have a problem . I have to draw a circle at a particular distance say 50 meters from a given lat/log.I refered to Aviation formula's and find a formula to calculate lat/log at a distance and
at a bearing which is as follows:-
A point {lat,lon} is a distance d out on the tc radial from point 1 if:
lat=asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos
(tc))
IF (cos(lat)=0)
lon=lon1 // endpoint a pole
ELSE
lon=mod(lon1-asin(sin(tc)*sin(d)/cos
(lat))+pi,2*pi)-pi
ENDIF
This algorithm is limited to distances such that dlon <pi/2, i.e those that extend around less
than one quarter of the circumference of the earth in longitude. A completely general, but more complicated algorithm is necessary if greater distances are allowed:
lat =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
dlon=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin
(lat1)*sin(lat))
lon=mod( lon1-dlon +pi,2*pi )-pi
for this i have written this coding:-
Private Sub cmdNextPoint_Click()
Dim lat2 As Double, lon2 As Double, theta As Double, d As Double,Aasin As Double,Aatan2 As Double
Pi = 3.14159265358979
d = 50
theta = 90 * 0.0174532925
txtLatitude.Text = 22.51791
txtLongitude.Text = 87.46598
Aasin = Sin(Val(txtLatitude.Text)) * Cos(d) + Cos(Val(txtLatitude.Text)) * Sin(d) * Cos(theta)
lat2 = atan2(Aasin, Sqr(1 - Aasin * Aasin))
Aatan2 = Sin(theta) * Sin(d) * Cos(Val(txtLatitude.Text))
Batan2 = Cos(d) - Sin(Val(txtLatitude.Text)) * Sin(lat2)
lon2 = ((Val(txtLongitude.Text) - atan2(Aatan2, Batan2) + Pi) Mod (2 * Pi)) - Pi
txtLatitude2.Text = lat2
txtLongitude2.Text = lon2
End Sub
Public Function atan2(ByVal y As Double, ByVal x As Double) As Double
If y > 0 Then
If x >= y Then
atan2 = Atn(y / x)
ElseIf x <= -y Then
atan2 = Atn(y / x) + Pi
Else
atan2 = Pi / 2 - Atn(x / y)
End If
Else
If x >= -y Then
atan2 = Atn(y / x)
ElseIf x <= y Then
atan2 = Atn(y / x) - Pi
Else
atan2 = -Atn(x / y) - Pi / 2
End If
End If
End Function
in this i m finding a point which is at a distance of 50 meters from the latitude 22.51791 and longitude 87.46598 and at a bearing of 90 degrees.Somebody told me that to draw a circle i have to find out 360 points then by using the DrawPolygon method the circle can be drawn.So firstly i m finding one point.It is not giving me the desired result that should be latitude = 22.51841 and longitude = 87.46598.Can anybody help me .Just tell me where i m wrong.I m using the mapwingis activex control to display the map.
|
|
|
|
|
Hi,
I did not look into your code or formulas as they are pretty unreadable; you should enclose the lot with PRE tags.
If you get trig functions completely wrong, the most likely cause is you forgot in most languages and math packages the angular units are radians, not degrees. So you need a factor, say in C#:
double ToRadians=Math.PI/180;
or something similar in VB.NET
PS: Notice the effect of PRE tags?
|
|
|
|
|
I'm no expert on the math, but it appears that not all the values you are passing to the Trig functions are expressed in Radians. It appears that you're using Radians in some calls, but Degrees in others. This will definately give you bad results.
|
|
|
|
|
Visual
I have design a form(frmembmst). On the particular form i have used a text box. On the lost focus of text box i have called a form(frmhelp) which have many contorl (textbox,datagrid view,two command buttons(ok,cancel)).
On the event of text change (frmhelp) record are coming succesfully.
My question is :
when I type any text in text Box focus should go on partiular cell.
if i click and enter on ok-command button then selected record should set in frmembmst-textbox.
Thanks
From
Ganesh Joshimodified on Thursday, March 18, 2010 3:24 AM
|
|
|
|
|
in which language are you working ?. Their are number of grids available which provide more then that functionality. what problem are you facing? SOFTDEV
If you have knowledge, let others light their candles at it. [ Let's work to help developers, not make them feel stupid ]
|
|
|
|
|
what are the basic things we need to do automation in vb? with back end as ms access.
|
|
|
|
|
What do you need to automate? The code for automatng a robot would be vastly different from the code to automate excel or word. Please be more specific.
|
|
|
|
|
You need to do two things:
1. Read the sticky posts above.
2. Define automation.
|
|
|
|
|
can v use vb in excel? if s how to use?
|
|
|
|
|
Again, would you mind being a bit descriptive. Are you looking to play with Excel from a VB code or want to do something like macro.
|
|
|
|
|
ya some thing like macro.
|
|
|
|
|
it is something like i should have list box with list of employee names and a button start and stop. while clicking start button the employee time of work starts after his work gets over he wil press stop button. this is my requirement.
|
|
|
|
|
Yes we can use vb in EXCEL that is called VBA. If you can think then I Can.
|
|
|
|
|
You can use VBA in Excel, use the Developer section and it is there.
Within this you can call a VB program from within the VBA.
It is very flexible.------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
If I have a sub routine/function with several parameters say 8 and I wanted to make the thread a background process or thread it in some way how could I accomplish that?
I see with System.Threading.ThreadPool.QueueUserWorkItem() that I can pass in single param but obviously that does not work here.Humble Programmer
|
|
|
|
|
programmer_vb.net_c++ wrote: but obviously that does not work here.
obviously a single parameter is everything you will ever need, as you can create a little class (or struct), stuff anything in there you want, then pass a reference as the single parameter.
There is one alternative that I often prefer: rather than having a data-only class, make a job class that holds all the parameters you want and also includes the code it needs. You can encapsulate a Thread or a BackgroundWorker, you could even inherit from BackgroundWorker (not from Thread as that class is sealed). That way all the threading is hidden inside that class.
|
|
|
|
|
Again Luc to rescue.
Thank you again.Humble Programmer
|
|
|
|
|
You're welcome.
|
|
|
|
|
I am in a project that has no multithreading. I understand the multithreading concepts and I can write basic apps but most places in our apps that I believe would benefit from multithreading we are accessing controls on the form so of course I get the cross threaded operation error.
Is there an elegant solution to updating UI elements from a secondary thread.
An example would be like having a secondary thread retrieve data from the DB and update the UI with the current info.
Another thing, are there any tools or ideas of how I can decide which parts of my application would benefit most multithreading.
This is sad but it is true, I came into developing in tried to be productive immediately so many important concepts got left behind and each time I try to implement new things that I have learned it seems that I am always fighting the basic design of the application.Humble Programmer
|
|
|
|
|
Hi,
This[^] tackles the thread crossings.
Multi-threading is useful:
- when independent operations could and should occur at the same time, rather than in a fixed and sequential order;
- when your app is compute bound and your system has more than one core, not all of them busy right now.
There is no need for tools to analyze this, just a bit of common sense should suffice.
|
|
|
|
|
Multi-threading is useful:
- when independent operations could and should occur at the same time, rather than in a fixed and sequential order;
I guess that is alot of the issue we are having is that everything is so structured in the order that there are only a few instances that I can think of that we can go on about are way and not worry about the thread finishing before we move on...
For example I would think that retrieving data on a separate thread would be a good idea but there is not really anything for the user to be doing before they have the information.
Or saving the data on a separate thread but then the information might not be available if they went right back into the form..Humble Programmer
|
|
|
|
|
Hi,
as I don't know anything about your app, I can only give general ideas and examples.
independent operations:
- example: reading data from two serial ports; if you intertwine read operations on a single thread, then the slowest port will dictate the speed of both; with asynchronous events or threads, both ports would evolve at their own speed.
- example: reading data from a disk file and from a network; the inherent speed of each could vary, so best results require independent operation
A decent app keeps the GUI free by delegating all jobs that take time (calculations > 100 milliseconds), or potentially take time (reading file over network) to separate threads. Net result:
- the GUI remains alive, if another window moves over it, or the user clicks minimize/maximize, it will still react;
- the GUI should offer progress information;
- the GUI should offer a cancel option.
Doing this properly requires at least one extra thread.
|
|
|
|
|
Insightful as usual Luc.
Thank you again for your time and plethora of knowledge.
Humble Programmer
|
|
|
|